On 2/1/06, Herbert Xu <[EMAIL PROTECTED]> wrote: > Ian McDonald <[EMAIL PROTECTED]> wrote: > > > > --- a/net/core/sock.c > > +++ b/net/core/sock.c > > @@ -162,7 +162,8 @@ static int sock_set_timeout(long *timeo_ > > if (tv.tv_sec == 0 && tv.tv_usec == 0) > > return 0; > > if (tv.tv_sec < (MAX_SCHEDULE_TIMEOUT/HZ - 1)) > > - *timeo_p = tv.tv_sec*HZ + > > (tv.tv_usec+(1000000/HZ-1))/(1000000/HZ); > > + *timeo_p = tv.tv_sec*HZ + > > + (tv.tv_usec+(USEC_PER_SEC/HZ-1))/(USEC_PER_SEC/HZ); > > Is there a macro for this calculation? If not could we add one? > I don't know if there is or not. There is similar code in DCCP. I think the way forward is to use hrtimers (http://lwn.net/Articles/167897/) as there are currently problems with NTP changing time which affects jiffies. In the meantime this patch makes the code a little bit tidier so I think it should go in...
Ian -- Ian McDonald http://wand.net.nz/~iam4 WAND Network Research Group University of Waikato New Zealand - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
