[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y34D+CnkhVRcneet@FVFF77S0Q05N>
Date: Wed, 23 Nov 2022 11:28:56 +0000
From: Mark Rutland <mark.rutland@....com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Uros Bizjak <ubizjak@...il.com>, linux-kernel@...r.kernel.org,
Josh Poimboeuf <jpoimboe@...nel.org>,
Jason Baron <jbaron@...mai.com>,
Ard Biesheuvel <ardb@...nel.org>
Subject: Re: [PATCH] jump_label: use atomic_try_cmpxchg in
static_key_slow_inc_cpuslocked
On Wed, Nov 23, 2022 at 10:08:59AM +0100, Peter Zijlstra wrote:
> On Tue, Nov 22, 2022 at 04:14:46PM -0500, Steven Rostedt wrote:
>
> > > + for (int v = atomic_read(&key->enabled); v > 0; )
> >
> > Although it's permitted by the compiler, the kernel style is to not add
> > declarations in conditionals.
>
> I'm thinking the whole motivation for upping to C99 was exactly so that
> we could start using this pattern.
That was one reason, yes. Marco and I wanted to be able to use C99-style
declarations in for loops to make it easier/possible to build macros with
locally-scoped control variables.
I personally prefer using C99-style declarations in for loops, but I don't have
a strong feeling that we *must* do so.
Thanks,
Mark.
Powered by blists - more mailing lists