diff options
-rw-r--r-- | include/linux/jiffies.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 043376920f51..329ebcffa106 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
@@ -47,8 +47,8 @@ | |||
47 | * - (NOM / DEN) fits in (32 - LSH) bits. | 47 | * - (NOM / DEN) fits in (32 - LSH) bits. |
48 | * - (NOM % DEN) fits in (32 - LSH) bits. | 48 | * - (NOM % DEN) fits in (32 - LSH) bits. |
49 | */ | 49 | */ |
50 | #define SH_DIV(NOM,DEN,LSH) ( ((NOM / DEN) << LSH) \ | 50 | #define SH_DIV(NOM,DEN,LSH) ( (((NOM) / (DEN)) << (LSH)) \ |
51 | + (((NOM % DEN) << LSH) + DEN / 2) / DEN) | 51 | + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN)) |
52 | 52 | ||
53 | /* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */ | 53 | /* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */ |
54 | #define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8)) | 54 | #define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8)) |