mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Suraj Upadhyay <usuraj35@gmail.com>
Cc: josh@joshtriplett.org, rostedt@goodmis.org,
	mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com,
	joel@joelfernandes.org, madhuparnabhowmik10@gmail.com,
	rcu@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rculist: Silence unused-value warning.
Date: Sun, 19 Jul 2020 09:07:47 -0700	[thread overview]
Message-ID: <20200719160747.GE9247@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <20200719105037.GA21010@blackclown>

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
> 



  reply	other threads:[~2020-07-19 16:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-19 10:50 Suraj Upadhyay
2020-07-19 16:07 ` Paul E. McKenney [this message]
     [not found]   ` <CAGbbQbG5ZLRhc+nxLqM35K3_cbXKw3AM1hXPm0fkyBEfRRhAnA@mail.gmail.com>
2020-07-19 18:42     ` Paul E. McKenney

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=20200719160747.GE9247@paulmck-ThinkPad-P72 \
    --to=paulmck@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madhuparnabhowmik10@gmail.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=usuraj35@gmail.com \
    /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

all inboxes | Powered by JetHome®