Skip to contentSkip to conversation

Add parenthesis around arguments in the SH_DIV macro.

PATCH New Uwe Zeisberger 1 participant 1 message Jul 26, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add parenthesis around arguments in the SH_DIV macro.

There is currently no affected user in the tree, but usage is less surprising that way.

---

 include/linux/jiffies.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/linux/jiffies.h +2 -2
index 0433769..329ebcf 100644
@@ -47,8 +47,8 @@ #define LATCH_HPET ((HPET_TICK_RATE + HZ
  *   - (NOM / DEN) fits in (32 - LSH) bits.
  *   - (NOM % DEN) fits in (32 - LSH) bits.
  */
-#define SH_DIV(NOM,DEN,LSH) (   ((NOM / DEN) << LSH)                    \
-                             + (((NOM % DEN) << LSH) + DEN / 2) / DEN)
+#define SH_DIV(NOM,DEN,LSH) (   (((NOM) / (DEN)) << (LSH))              \
+                             + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN))
 
 /* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */
 #define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8))
Signature · 9 lines
1.4.2.rc1.g83e1


-- 
Uwe Zeisberger
FS Forth-Systeme GmbH, A Digi International Company
Kueferstrasse 8, D-79206 Breisach, Germany
Phone: +49 (7667) 908 0 Fax: +49 (7667) 908 200
Web: www.fsforth.de, www.digi.com