From: Kees Cook <keescook@chromium.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>, linux-kernel@vger.kernel.org
Subject: [PATCH] timer: Add parenthesis around timer_setup() macro arguments
Date: Wed, 1 Nov 2017 07:32:50 -0700 [thread overview]
Message-ID: <20171101143250.GA65266@beast> (raw)
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
next reply other threads:[~2017-11-01 14:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-01 14:32 Kees Cook [this message]
2017-11-01 18:10 ` [tip:timers/core] timer: Add parenthesis around timer_setup() macro arguments 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171101143250.GA65266@beast \
--to=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox