lkml.org 
[lkml]   [2022]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] jump_label: use atomic_try_cmpxchg in static_key_slow_inc_cpuslocked
On Wed, 23 Nov 2022 10:08:59 +0100
Peter Zijlstra <peterz@infradead.org> 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.

OK, if you are fine with it then sure. I personally like seeing all
variables declared in one place. Maybe because I've been trained that way,
and I can easily be confused when I see a variable somewhere and don't see
it in the beginning declarations.

-- Steve

\
 
 \ /
  Last update: 2022-11-23 14:42    [W:1.172 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site