Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1385228

Re: [RFC][PATCH 01/31] locking: Flip arguments to atomic_fetch_or

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH 01/31] locking: Flip arguments to atomic_fetch_or
Date 2016-04-22 16:30 +0200
Message-ID <rqKfM-3ke-13@gated-at.bofh.it> (permalink)
References <rqFSN-8hs-3@gated-at.bofh.it> <rqG2x-8lR-61@gated-at.bofh.it> <rqH8g-ZP-67@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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'.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFC][PATCH 01/31] locking: Flip arguments to atomic_fetch_or Peter Zijlstra <peterz@infradead.org> - 2016-04-22 12:00 +0200
  Re: [RFC][PATCH 01/31] locking: Flip arguments to atomic_fetch_or Will Deacon <will.deacon@arm.com> - 2016-04-22 13:00 +0200
  Re: [RFC][PATCH 01/31] locking: Flip arguments to atomic_fetch_or Geert Uytterhoeven <geert@linux-m68k.org> - 2016-04-22 13:10 +0200
    Re: [RFC][PATCH 01/31] locking: Flip arguments to atomic_fetch_or Peter Zijlstra <peterz@infradead.org> - 2016-04-22 16:30 +0200

csiph-web