clocksource: sun4i: Wrap macros arguments in parenthesis
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Tue, 16 Jul 2013 14:45:37 +0000 (16:45 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 18 Jul 2013 13:27:13 +0000 (15:27 +0200)
The macros were not using parenthesis to escape the arguments passed to
them. It is pretty unsafe, so add those parenthesis.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/clocksource/sun4i_timer.c

index bdf34d9..34ab658 100644 (file)
@@ -30,8 +30,8 @@
 #define TIMER_CTL_ENABLE               BIT(0)
 #define TIMER_CTL_AUTORELOAD           BIT(1)
 #define TIMER_CTL_ONESHOT              BIT(7)
-#define TIMER_INTVAL_REG(val)  (0x10 * val + 0x14)
-#define TIMER_CNTVAL_REG(val)  (0x10 * val + 0x18)
+#define TIMER_INTVAL_REG(val)  (0x10 * (val) + 0x14)
+#define TIMER_CNTVAL_REG(val)  (0x10 * (val) + 0x18)
 
 #define TIMER_SCAL             16