All of lore.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

* [tip:timers/core] timer: Add parenthesis around timer_setup() macro arguments
  2017-11-01 14:32 [PATCH] timer: Add parenthesis around timer_setup() macro arguments Kees Cook
@ 2017-11-01 18:10 ` tip-bot for Kees Cook
  2017-11-02  2:33 ` [PATCH] " Stephen Rothwell
  1 sibling, 0 replies; 5+ messages in thread
From: tip-bot for Kees Cook @ 2017-11-01 18:10 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: hpa, sfr, keescook, tglx, linux-kernel, mingo

Commit-ID:  00ed87da35e88a7a4d7f41673beab52ef828f12b
Gitweb:     https://git.kernel.org/tip/00ed87da35e88a7a4d7f41673beab52ef828f12b
Author:     Kees Cook <keescook@chromium.org>
AuthorDate: Wed, 1 Nov 2017 07:32:50 -0700
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 1 Nov 2017 19:05:05 +0100

timer: Add parenthesis around timer_setup() macro arguments

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 | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/linux/timer.h b/include/linux/timer.h
index 0995048..a1af92b 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) \

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

* Re: [PATCH] timer: Add parenthesis around timer_setup() macro arguments
  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 ` Stephen Rothwell
  2017-11-02  3:04   ` Kees Cook
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2017-11-02  2:33 UTC (permalink / raw)
  To: Kees Cook; +Cc: Thomas Gleixner, linux-kernel

Hi Kees,

On Wed, 1 Nov 2017 07:32:50 -0700 Kees Cook <keescook@chromium.org> wrote:
>
> 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>

I have applied that patch to linux-next today pending it appearing in
the tip tree.
-- 
Cheers,
Stephen Rothwell

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

* Re: [PATCH] timer: Add parenthesis around timer_setup() macro arguments
  2017-11-02  2:33 ` [PATCH] " Stephen Rothwell
@ 2017-11-02  3:04   ` Kees Cook
  2017-11-02  3:40     ` Stephen Rothwell
  0 siblings, 1 reply; 5+ messages in thread
From: Kees Cook @ 2017-11-02  3:04 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Thomas Gleixner, LKML

On Wed, Nov 1, 2017 at 7:33 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi Kees,
>
> On Wed, 1 Nov 2017 07:32:50 -0700 Kees Cook <keescook@chromium.org> wrote:
>>
>> 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>
>
> I have applied that patch to linux-next today pending it appearing in
> the tip tree.

Thanks! It should be there in tip/timers/core as of several hours ago.

-Kees

-- 
Kees Cook
Pixel Security

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

* Re: [PATCH] timer: Add parenthesis around timer_setup() macro arguments
  2017-11-02  3:04   ` Kees Cook
@ 2017-11-02  3:40     ` Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2017-11-02  3:40 UTC (permalink / raw)
  To: Kees Cook; +Cc: Thomas Gleixner, LKML

Hi Kees,

On Wed, 1 Nov 2017 20:04:05 -0700 Kees Cook <keescook@chromium.org> wrote:
>
> On Wed, Nov 1, 2017 at 7:33 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > Hi Kees,
> >
> > On Wed, 1 Nov 2017 07:32:50 -0700 Kees Cook <keescook@chromium.org> wrote:  
> >>
> >> 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>  
> >
> > I have applied that patch to linux-next today pending it appearing in
> > the tip tree.  
> 
> Thanks! It should be there in tip/timers/core as of several hours ago.

Yeah, but there is some testing done before it is included the
auto-latest branch, which is what I fetch for linux-next.

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.