All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rculist: Silence unused-value warning.
@ 2020-07-19 10:50 Suraj Upadhyay
  2020-07-19 16:07 ` Paul E. McKenney
  0 siblings, 1 reply; 3+ messages in thread
From: Suraj Upadhyay @ 2020-07-19 10:50 UTC (permalink / raw)
  To: paulmck, josh, rostedt, mathieu.desnoyers, jiangshanlai, joel,
	madhuparnabhowmik10
  Cc: rcu, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 916 bytes --]

The macro __list_check_srcu is used as a statement inside a for loop.

__list_check_srcu becomes "true" when CONFIG_PROVE_RCU_LIST is not defined.
This results in compiler warning about an unused value ("true").

Silence the compiler warning about the unused value "true"
by replacing it with an empty expression.

Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
---
 include/linux/rculist.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index de9385b9158e..8b8e0584c473 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -73,7 +73,7 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list)
 #define __list_check_rcu(dummy, cond, extra...)				\
 	({ check_arg_count_one(extra); })
 
-#define __list_check_srcu(cond) true
+#define __list_check_srcu(cond) ({})
 #endif
 
 /*
-- 
2.17.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] rculist: Silence unused-value warning.
  2020-07-19 10:50 [PATCH] rculist: Silence unused-value warning Suraj Upadhyay
@ 2020-07-19 16:07 ` Paul E. McKenney
       [not found]   ` <CAGbbQbG5ZLRhc+nxLqM35K3_cbXKw3AM1hXPm0fkyBEfRRhAnA@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Paul E. McKenney @ 2020-07-19 16:07 UTC (permalink / raw)
  To: Suraj Upadhyay
  Cc: josh, rostedt, mathieu.desnoyers, jiangshanlai, joel,
	madhuparnabhowmik10, rcu, linux-kernel

On Sun, Jul 19, 2020 at 04:20:37PM +0530, Suraj Upadhyay wrote:
> The macro __list_check_srcu is used as a statement inside a for loop.
> 
> __list_check_srcu becomes "true" when CONFIG_PROVE_RCU_LIST is not defined.
> This results in compiler warning about an unused value ("true").
> 
> Silence the compiler warning about the unused value "true"
> by replacing it with an empty expression.
> 
> Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>

Like this, you mean, give or take whitespace?  ;-)

https://lore.kernel.org/lkml/20200718001259.GY9247@paulmck-ThinkPad-P72/

May I add your Tested-by?

							Thanx, Paul

> ---
>  include/linux/rculist.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/rculist.h b/include/linux/rculist.h
> index de9385b9158e..8b8e0584c473 100644
> --- a/include/linux/rculist.h
> +++ b/include/linux/rculist.h
> @@ -73,7 +73,7 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list)
>  #define __list_check_rcu(dummy, cond, extra...)				\
>  	({ check_arg_count_one(extra); })
>  
> -#define __list_check_srcu(cond) true
> +#define __list_check_srcu(cond) ({})
>  #endif
>  
>  /*
> -- 
> 2.17.1
> 



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

* Re: [PATCH] rculist: Silence unused-value warning.
       [not found]   ` <CAGbbQbG5ZLRhc+nxLqM35K3_cbXKw3AM1hXPm0fkyBEfRRhAnA@mail.gmail.com>
@ 2020-07-19 18:42     ` Paul E. McKenney
  0 siblings, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2020-07-19 18:42 UTC (permalink / raw)
  To: Suraj Upadhyay
  Cc: josh, rostedt, mathieu.desnoyers, jiangshanlai, joel,
	madhuparnabhowmik10, rcu, linux-kernel

On Sun, Jul 19, 2020 at 10:53:05PM +0530, Suraj Upadhyay wrote:
> On Sun 19 Jul, 2020, 21:37 Paul E. McKenney, <paulmck@kernel.org> wrote:
> 
> > On Sun, Jul 19, 2020 at 04:20:37PM +0530, Suraj Upadhyay wrote:
> > > The macro __list_check_srcu is used as a statement inside a for loop.
> > >
> > > __list_check_srcu becomes "true" when CONFIG_PROVE_RCU_LIST is not
> > defined.
> > > This results in compiler warning about an unused value ("true").
> > >
> > > Silence the compiler warning about the unused value "true"
> > > by replacing it with an empty expression.
> > >
> > > Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
> >
> > Like this, you mean, give or take whitespace?  ;-)
> >
> > https://lore.kernel.org/lkml/20200718001259.GY9247@paulmck-ThinkPad-P72/
> >
> > May I add your Tested-by?
> >
> >                                                         Thanx, Paul
> >
> 
> Yeah sure.

Thank you, I have applied it and it will be public on my next rebase.
And thank you for your testing efforts!

							Thanx, Paul

> Thanks,
> 
> Suraj Upadhyay.
> 
> > ---
> > >  include/linux/rculist.h | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/include/linux/rculist.h b/include/linux/rculist.h
> > > index de9385b9158e..8b8e0584c473 100644
> > > --- a/include/linux/rculist.h
> > > +++ b/include/linux/rculist.h
> > > @@ -73,7 +73,7 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head
> > *list)
> > >  #define __list_check_rcu(dummy, cond, extra...)
> >       \
> > >       ({ check_arg_count_one(extra); })
> > >
> > > -#define __list_check_srcu(cond) true
> > > +#define __list_check_srcu(cond) ({})
> > >  #endif
> > >
> > >  /*
> > > --
> > > 2.17.1
> > >
> >
> >
> >

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

end of thread, other threads:[~2020-07-19 18:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-19 10:50 [PATCH] rculist: Silence unused-value warning Suraj Upadhyay
2020-07-19 16:07 ` Paul E. McKenney
     [not found]   ` <CAGbbQbG5ZLRhc+nxLqM35K3_cbXKw3AM1hXPm0fkyBEfRRhAnA@mail.gmail.com>
2020-07-19 18:42     ` Paul E. McKenney

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.