]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
timer: Add parenthesis around timer_setup() macro arguments
authorKees Cook <keescook@chromium.org>
Wed, 1 Nov 2017 14:32:50 +0000 (07:32 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 1 Nov 2017 18:05:05 +0000 (19:05 +0100)
In the case where expressions are passed as macro arguments, the LOCKDEP
version of the timer macros need enclosing parenthesis.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20171101143250.GA65266@beast
include/linux/timer.h

index 09950482309bb0de2003d44d5b3d6b273f23d33c..a1af92bac0d5ef59bad750913aeac1a1793273d2 100644 (file)
@@ -173,11 +173,12 @@ static inline void timer_setup_on_stack(struct timer_list *timer,
  * do want to keep the inline for argument type checking, though.
  */
 # define timer_setup(timer, callback, flags)                           \
-               __setup_timer(timer, (TIMER_FUNC_TYPE)callback,         \
-                             (TIMER_DATA_TYPE)timer, flags)
+               __setup_timer((timer), (TIMER_FUNC_TYPE)(callback),     \
+                             (TIMER_DATA_TYPE)(timer), (flags))
 # define timer_setup_on_stack(timer, callback, flags)                  \
-               __setup_timer_on_stack(timer, (TIMER_FUNC_TYPE)callback,\
-                                      (TIMER_DATA_TYPE)timer, flags)
+               __setup_timer_on_stack((timer),                         \
+                                      (TIMER_FUNC_TYPE)(callback),     \
+                                      (TIMER_DATA_TYPE)(timer), (flags))
 #endif
 
 #define from_timer(var, callback_timer, timer_fieldname) \