lkml.org 
[lkml]   [2016]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 01/31] locking: Flip arguments to atomic_fetch_or
On Fri, Apr 22, 2016 at 01:09:38PM +0200, Geert Uytterhoeven wrote:
> On Fri, Apr 22, 2016 at 11:04 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> > All the atomic operations have their arguments the wrong way around;
>
> s/wrong/other/?

Nah, I find they really are the wrong way around. I forever write:
atomic_add(&v, val); and then have the compiler yell at me.

> > make atomic_fetch_or() consistent and flip them.
>
> BTW, there are a few other inconsistencies:
>
> atomic_add_unless()
> atomic_cmpxchg()
> atomic_inc_not_zero_hint()
> atomic_set()
> atomic_xchg
>
> git grep "\<atomic_.*atomic_t\>.*\<int\>"

Yes, but fixing those will be much more pain :/ atomic_fetch_or() was
freshly introduced and only has a few callers, furthermore, the
following patches would require it to be in line with the other
atomic_$op() due to them all being generated from the same 'template'.


\
 
 \ /
  Last update: 2016-04-22 16:41    [W:0.081 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site