From: Alexey Dobriyan <adobriyan@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: mingo@redhat.com, will@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rwsem: fix commas in initialisation
Date: Mon, 13 Jul 2020 17:06:24 +0300 [thread overview]
Message-ID: <20200713140624.GA17904@localhost.localdomain> (raw)
In-Reply-To: <20200713115141.GH10769@hirez.programming.kicks-ass.net>
On Mon, Jul 13, 2020 at 01:51:41PM +0200, Peter Zijlstra wrote:
> On Sat, Jul 11, 2020 at 05:59:54PM +0300, Alexey Dobriyan wrote:
> > Leading comma prevents arbitrary reordering of initialisation clauses.
> > The whole point of C99 initialisation is to allow any such reordering.
>
> I'm conflicted on this argument, the only reason I'd be inclined to take
> this patch is that it allows fixing the initialization order to not be
> random.
Yes, this is how the issue was noticed.
> That is, I'd fold in the below.
>
> --- a/include/linux/rwsem.h
> +++ b/include/linux/rwsem.h
> @@ -89,9 +89,9 @@ static inline int rwsem_is_locked(struct
> #define __RWSEM_INITIALIZER(name) \
> { __RWSEM_INIT_COUNT(name), \
> .owner = ATOMIC_LONG_INIT(0), \
> - .wait_list = LIST_HEAD_INIT((name).wait_list), \
> - .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock),\
> __RWSEM_OPT_INIT(name) \
> + .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock),\
> + .wait_list = LIST_HEAD_INIT((name).wait_list), \
One less chunk to compile with g++, a billion to go :^)
next prev parent reply other threads:[~2020-07-13 14:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-11 14:59 [PATCH] rwsem: fix commas in initialisation Alexey Dobriyan
2020-07-13 11:51 ` Peter Zijlstra
2020-07-13 14:06 ` Alexey Dobriyan [this message]
2020-07-17 11:22 ` [tip: locking/core] " tip-bot2 for Alexey Dobriyan
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=20200713140624.GA17904@localhost.localdomain \
--to=adobriyan@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=will@kernel.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