public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] timer: Add parenthesis around timer_setup() macro arguments
@ 2017-11-01 14:32 Kees Cook
  2017-11-01 18:10 ` [tip:timers/core] " tip-bot for Kees Cook
  2017-11-02  2:33 ` [PATCH] " Stephen Rothwell
  0 siblings, 2 replies; 5+ messages in thread
From: Kees Cook @ 2017-11-01 14:32 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Stephen Rothwell, linux-kernel

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>
---
 include/linux/timer.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/linux/timer.h b/include/linux/timer.h
index 09950482309b..a1af92bac0d5 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -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) \
-- 
2.7.4


-- 
Kees Cook
Pixel Security

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-02  3:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-01 14:32 [PATCH] timer: Add parenthesis around timer_setup() macro arguments Kees Cook
2017-11-01 18:10 ` [tip:timers/core] " tip-bot for Kees Cook
2017-11-02  2:33 ` [PATCH] " Stephen Rothwell
2017-11-02  3:04   ` Kees Cook
2017-11-02  3:40     ` Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox