Re: [RFC][PATCH 1/4] add jiffies_to_nsecs() helper and fix up size of usecs

2005-07-16 Thread Nishanth Aravamudan
On 15.07.2005 [14:14:25 +0200], Pavel Machek wrote: > Hi! > > > > > +static inline u64 jiffies_to_nsecs(const unsigned long j) > > > > +{ > > > > +#if HZ <= NSEC_PER_SEC && !(NSEC_PER_SEC % HZ) > > > > + return (NSEC_PER_SEC / HZ) * (u64)j; > > > > +#elif HZ > NSEC_PER_SEC && !(HZ % NSEC_PER

Re: [RFC][PATCH 1/4] add jiffies_to_nsecs() helper and fix up size of usecs

2005-07-16 Thread Pavel Machek
Hi! > > > +static inline u64 jiffies_to_nsecs(const unsigned long j) > > > +{ > > > +#if HZ <= NSEC_PER_SEC && !(NSEC_PER_SEC % HZ) > > > + return (NSEC_PER_SEC / HZ) * (u64)j; > > > +#elif HZ > NSEC_PER_SEC && !(HZ % NSEC_PER_SEC) > > > + return ((u64)j + (HZ / NSEC_PER_SEC) - 1)/(HZ / NSEC_PER_S

Re: [RFC][PATCH 1/4] add jiffies_to_nsecs() helper and fix up size of usecs

2005-07-14 Thread Nishanth Aravamudan
On 14.07.2005 [13:54:47 -0700], Dave Hansen wrote: > On Thu, 2005-07-14 at 13:28 -0700, Nishanth Aravamudan wrote: > > +static inline u64 jiffies_to_nsecs(const unsigned long j) > > +{ > > +#if HZ <= NSEC_PER_SEC && !(NSEC_PER_SEC % HZ) > > + return (NSEC_PER_SEC / HZ) * (u64)j; > > +#elif HZ > N

Re: [RFC][PATCH 1/4] add jiffies_to_nsecs() helper and fix up size of usecs

2005-07-14 Thread Dave Hansen
On Thu, 2005-07-14 at 13:28 -0700, Nishanth Aravamudan wrote: > +static inline u64 jiffies_to_nsecs(const unsigned long j) > +{ > +#if HZ <= NSEC_PER_SEC && !(NSEC_PER_SEC % HZ) > + return (NSEC_PER_SEC / HZ) * (u64)j; > +#elif HZ > NSEC_PER_SEC && !(HZ % NSEC_PER_SEC) > + return ((u64)j +

[RFC][PATCH 1/4] add jiffies_to_nsecs() helper and fix up size of usecs

2005-07-14 Thread Nishanth Aravamudan
From: Nishanth Aravamudan <[EMAIL PROTECTED]> Description: Add a jiffies_to_nsecs() helper function. Make consistent the size of microseconds (unsigned long) throughout the conversion functions. Signed-off-by: Nishanth Aravamudan <[EMAIL PROTECTED]> --- jiffies.h | 15 +-- 1 file