lkml.org 
[lkml]   [2004]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Consolidate multiple implementations of jiffies-msecs conversions.
Sridhar Samudrala wrote:
>
> The following patch to 2.6.5-rc2 consolidates 6 different implementations
> of msecs to jiffies and 3 different implementation of jiffies to msecs.
> All of them now use the generic msecs_to_jiffies() and jiffies_to_msecs()
> that are added to include/linux/time.h
>[...]
> -#define MSECS(ms) (((ms)*HZ/1000)+1)
> -return (((ms)*HZ+999)/1000);
> +return (msecs / 1000) * HZ + (msecs % 1000) * HZ / 1000;

Did you check that all users of the new version will work correctly
with your rounding? Explicit round-up of delays is often required,
especially when talking to hardware...

Ciao, ET.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:01    [W:6.099 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site