Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754380AbbGJJOO (ORCPT ); Fri, 10 Jul 2015 05:14:14 -0400 Received: from smtprelay4.synopsys.com ([198.182.47.9]:58090 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753589AbbGJJOH convert rfc822-to-8bit (ORCPT ); Fri, 10 Jul 2015 05:14:07 -0400 From: Vineet Gupta To: Geert Uytterhoeven , Peter Zijlstra CC: "linux-kernel@vger.kernel.org" , Linux-Arch , Richard Henderson , "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 Thread-Topic: [RFC][PATCH 23/24] atomic: Collapse all atomic_{set,clear}_mask definitions Thread-Index: AQHQunCTY/HERTBzq0u79nthplHP9w== Date: Fri, 10 Jul 2015 09:13:58 +0000 Message-ID: References: <20150709172855.564686637@infradead.org> <20150709175310.229218215@infradead.org> Accept-Language: en-US, en-IN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.12.197.226] Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1051 Lines: 33 On Friday 10 July 2015 02:40 PM, 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 > > What about atomic_clear()? (Is atomic_bic() too ARM-centric?) > ARM + ARC centric :-) We have the BIC instruction as well which does the same: A & ~B -Vineet -- 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/