Skip to content

Commit

Permalink
timer: Add parenthesis around timer_setup() macro arguments
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Kees Cook authored and Thomas Gleixner committed Nov 1, 2017
1 parent 39c82ca commit 00ed87d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions include/linux/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit 00ed87d

Please sign in to comment.