Ian McDonald <[EMAIL PROTECTED]> wrote: > 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
I just had a look and usecs_to_jiffies seems to do what you want. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt - 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