[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <af5b457c-6615-0b4c-0add-529a28454459@rasmusvillemoes.dk>
Date: Wed, 28 Oct 2020 08:51:29 +0100
From: Rasmus Villemoes <linux@...musvillemoes.dk>
To: Arnd Bergmann <arnd@...nel.org>,
Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
"Ahmed S. Darwish" <a.darwish@...utronix.de>,
"Paul E. McKenney" <paulmck@...nel.org>,
Marco Elver <elver@...gle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] seqlock: avoid -Wshadow warnings
On 28/10/2020 00.34, Arnd Bergmann wrote:
> On Mon, Oct 26, 2020 at 5:58 PM Peter Zijlstra <peterz@...radead.org> wrote:
>>
>> On Mon, Oct 26, 2020 at 05:50:38PM +0100, Arnd Bergmann wrote:
>>
>>> - unsigned seq; \
>>> + unsigned __seq; \
>>
>>> - unsigned seq = __read_seqcount_begin(s); \
>>> + unsigned _seq = __read_seqcount_begin(s); \
>>
>>> - unsigned seq = __seqcount_sequence(s); \
>>> + unsigned __seq = __seqcount_sequence(s); \
>>
>> Can we have a consistent number of leading '_' ?
>
> Not really ;-)
>
> The warning comes from raw_read_seqcount_begin() calling
> __read_seqcount_begin() and both using the same variable
> name. I could rename one of them and use double-underscores
> for both, but I haven't come up with a good alternative name
> that wouldn't make it less consistent in the process.
At least x86's put_user and get_user use _pu/_gu suffixes on their local
variables, so perhaps that could be made a weak default convention?
__seq_rsb
__seq_rrsb
__seq_rrs
Hm, or perhaps not. But it's still better than triplicating each macro
to do a UNIQUE_ID dance.
Rasmus
Powered by blists - more mailing lists