From: "Paul E. McKenney" <paulmck@linux.ibm.com>
To: Joe Perches <joe@perches.com>
Cc: Andrea Parri <andrea.parri@amarulasolutions.com>,
linux-kernel@vger.kernel.org,
Josh Triplett <josh@joshtriplett.org>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Joel Fernandes <joel@joelfernandes.org>,
rcu@vger.kernel.org, Peter Zijlstra <peterz@infradead.org>,
Will Deacon <will.deacon@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Matthew Wilcox <willy@infradead.org>,
Sasha Levin <sashal@kernel.org>,
apw@canonical.com
Subject: Re: [PATCH v2] rcu: Don't return a value from rcu_assign_pointer()
Date: Mon, 27 May 2019 10:49:01 -0700 [thread overview]
Message-ID: <20190527174901.GL28207@linux.ibm.com> (raw)
In-Reply-To: <810a0dae47c90c39015903c413303fcee89ab5eb.camel@perches.com>
On Mon, May 27, 2019 at 10:21:22AM -0700, Joe Perches wrote:
> On Mon, 2019-05-27 at 09:10 -0700, Paul E. McKenney wrote:
> > On Mon, May 27, 2019 at 10:49:57AM +0200, Andrea Parri wrote:
> > > Quoting Paul [1]:
> > >
> > > "Given that a quick (and perhaps error-prone) search of the uses
> > > of rcu_assign_pointer() in v5.1 didn't find a single use of the
> > > return value, let's please instead change the documentation and
> > > implementation to eliminate the return value."
> > >
> > > [1] https://lkml.kernel.org/r/20190523135013.GL28207@linux.ibm.com
> >
> > Queued, thank you!
> >
> > Adding the checkpatch maintainers on CC as well. The "do { } while
> > (0)" prevents the return value from being used, by design. Given the
> > checkpatch complaint, is there some better way to achieve this?
>
> Not sure what the checkpatch complaint is here.
Checkpatch seems to want at least two statements in each
"do { } while (0)" macro definition:
WARNING: Single statement macros should not use a do {} while (0) loop
> Reading the link above, there seems to be a compiler warning.
The compiler warning is a theoretical issue that is being fixed by this
patch, and the patch is giving the checkpatch warning.
> Perhaps a statement expression macro with no return value?
>
> #define rcu_assign_pointer(p, v) ({ (p) = (v); ; })
This is at best an acquired taste for me...
Thanx, Paul
next prev parent reply other threads:[~2019-05-27 17:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-27 8:49 [PATCH v2] rcu: Don't return a value from rcu_assign_pointer() Andrea Parri
2019-05-27 16:10 ` Paul E. McKenney
2019-05-27 17:21 ` Joe Perches
2019-05-27 17:49 ` Paul E. McKenney [this message]
2019-05-27 17:57 ` Joe Perches
2019-05-27 19:23 ` 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=20190527174901.GL28207@linux.ibm.com \
--to=paulmck@linux.ibm.com \
--cc=andrea.parri@amarulasolutions.com \
--cc=apw@canonical.com \
--cc=jiangshanlai@gmail.com \
--cc=joe@perches.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=peterz@infradead.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=sashal@kernel.org \
--cc=will.deacon@arm.com \
--cc=willy@infradead.org \
/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