From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754122AbcDVOUl (ORCPT ); Fri, 22 Apr 2016 10:20:41 -0400 Received: from merlin.infradead.org ([205.233.59.134]:41153 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753733AbcDVOUj (ORCPT ); Fri, 22 Apr 2016 10:20:39 -0400 Date: Fri, 22 Apr 2016 16:18:21 +0200 From: Peter Zijlstra To: Geert Uytterhoeven Cc: Linus Torvalds , Ingo Molnar , Thomas Gleixner , Will Deacon , Paul McKenney , boqun.feng@gmail.com, waiman.long@hpe.com, =?iso-8859-1?Q?Fr=E9d=E9ric?= Weisbecker , "linux-kernel@vger.kernel.org" , Linux-Arch , Richard Henderson , Vineet Gupta , Russell King , Hans-Christian Noren Egtvedt , Miao Steven , Yoshinori Sato , Richard Kuo , Tony Luck , James Hogan , Ralf Baechle , David Howells , "James E.J. Bottomley" , Michael Ellerman , Martin Schwidefsky , Rich Felker , "David S. Miller" , cmetcalf@mellanox.com, Max Filippov , Arnd Bergmann , dbueso@suse.de, Wu Fengguang Subject: Re: [RFC][PATCH 01/31] locking: Flip arguments to atomic_fetch_or Message-ID: <20160422141821.GQ3430@twins.programming.kicks-ass.net> References: <20160422090413.393652501@infradead.org> <20160422093923.095484070@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 22, 2016 at 01:09:38PM +0200, Geert Uytterhoeven wrote: > On Fri, Apr 22, 2016 at 11:04 AM, Peter Zijlstra 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 "\.*\" 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'.