Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932122AbbGJKkP (ORCPT ); Fri, 10 Jul 2015 06:40:15 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:48372 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753608AbbGJKkJ (ORCPT ); Fri, 10 Jul 2015 06:40:09 -0400 Date: Fri, 10 Jul 2015 12:39:45 +0200 From: Peter Zijlstra To: Geert Uytterhoeven Cc: "linux-kernel@vger.kernel.org" , Linux-Arch , Richard Henderson , Vineet Gupta , Russell King , Will Deacon , =?iso-8859-1?Q?H=E5vard?= Skinnemoen , Miao Steven , David Howells , Richard Kuo , Tony Luck , James Hogan , Ralf Baechle , "James E.J. Bottomley" , Benjamin Herrenschmidt , Heiko Carstens , "David S. Miller" , Chris Metcalf , Ingo Molnar Subject: Re: [RFC][PATCH 23/24] atomic: Collapse all atomic_{set,clear}_mask definitions Message-ID: <20150710103945.GH19282@twins.programming.kicks-ass.net> References: <20150709172855.564686637@infradead.org> <20150709175310.229218215@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 Content-Length: 992 Lines: 31 On Fri, Jul 10, 2015 at 11:10:33AM +0200, Geert Uytterhoeven wrote: > Hi Peter, > > On Thu, Jul 9, 2015 at 7:29 PM, Peter Zijlstra wrote: > > --- a/include/linux/atomic.h > > +++ b/include/linux/atomic.h > > @@ -28,6 +28,23 @@ static inline int atomic_add_unless(atom > > #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) > > #endif > > > > +#ifndef atomic_nand > > +static inline void atomic_nand(int i, atomic_t *v) > > +{ > > + atomic_and(~i, v); > > That sounds like a misnomer... > > Your NAND is "A & ~B", while my[*] NAND is "~(A & B)"? > > [*] https://en.wikipedia.org/wiki/NAND_logic Right you are. > What about atomic_clear()? (Is atomic_bic() too ARM-centric?) atomic_and_not() ? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/