Commit 0d94df56 authored by Uwe Zeisberger's avatar Uwe Zeisberger Committed by Linus Torvalds

[PATCH] Add parentheses around arguments in the SH_DIV macro.

There is currently no affected user in the tree, but usage is less
surprising that way.
Signed-off-by: default avatarUwe Zeisberger <Uwe_Zeisberger@digi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3c829c36
...@@ -47,8 +47,8 @@ ...@@ -47,8 +47,8 @@
* - (NOM / DEN) fits in (32 - LSH) bits. * - (NOM / DEN) fits in (32 - LSH) bits.
* - (NOM % DEN) fits in (32 - LSH) bits. * - (NOM % DEN) fits in (32 - LSH) bits.
*/ */
#define SH_DIV(NOM,DEN,LSH) ( ((NOM / DEN) << LSH) \ #define SH_DIV(NOM,DEN,LSH) ( (((NOM) / (DEN)) << (LSH)) \
+ (((NOM % DEN) << LSH) + DEN / 2) / DEN) + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN))
/* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */ /* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */
#define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8)) #define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment