Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754259AbbGJJKj (ORCPT ); Fri, 10 Jul 2015 05:10:39 -0400 Received: from mail-oi0-f54.google.com ([209.85.218.54]:34736 "EHLO mail-oi0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753559AbbGJJKe (ORCPT ); Fri, 10 Jul 2015 05:10:34 -0400 MIME-Version: 1.0 In-Reply-To: <20150709175310.229218215@infradead.org> References: <20150709172855.564686637@infradead.org> <20150709175310.229218215@infradead.org> Date: Fri, 10 Jul 2015 11:10:33 +0200 X-Google-Sender-Auth: Em1_0E_wYpk4F-WVhaosCSt6_4U Message-ID: Subject: Re: [RFC][PATCH 23/24] atomic: Collapse all atomic_{set,clear}_mask definitions From: Geert Uytterhoeven To: Peter Zijlstra Cc: "linux-kernel@vger.kernel.org" , Linux-Arch , Richard Henderson , Vineet Gupta , Russell King , Will Deacon , =?UTF-8?Q?H=C3=A5vard_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 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1338 Lines: 45 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?) > +} > +#endif > + > +static inline __deprecated void atomic_clear_mask(unsigned int mask, atomic_t *v) > +{ > + atomic_nand(mask, v); > +} Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- 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/