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


Groups > linux.kernel > #1181414

Re: [RFC][PATCH 23/24] atomic: Collapse all atomic_{set,clear}_mask definitions

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Geert Uytterhoeven <geert@linux-m68k.org>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH 23/24] atomic: Collapse all atomic_{set,clear}_mask definitions
Date Fri, 10 Jul 2015 11:20:02 +0200
Message-ID <pKCDo-44s-23@gated-at.bofh.it> (permalink)
References <pKoh3-3bp-3@gated-at.bofh.it> <pKoqJ-3ul-1@gated-at.bofh.it>
X-Original-To Peter Zijlstra <peterz@infradead.org>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=vYno7iEWfYe2jX22yU4ZQn12DfjE76gvoOmZpgrCqE0=; b=FaGOmkwXNpmUYS5iQXpELtzy8KiYOdLFsvHN28pIKNOdIbd1CVdFNPyLiSOoOCB5Xj dBp2paIaR+Z5lvsclCxx9W83X73qiPRWTXm8QkiV5L9MpIPipKAuTsgEfmmoRvoVhRES nBlvfJDy1JBorwl2OJYfyh9Rt8CjUlRCU1vRlvXHB8jbNZWDfBw3Q9cHS41chRyt98eT DbA2FJFt91NazEHJ0d5svceyoJFuZTwsBthcCIV+UUDz67PcAoNjXoYzlSf+xzgukD12 hdcHHd4pE/yN4dO59DAw0lVhgteVIn421IO2gV+5rBRAd4J0GxhU9+4xUiCR5Zn8N/FO 4h1w==
MIME-Version 1.0
X-Received by 10.202.239.138 with SMTP id n132mr16244509oih.99.1436519433864; Fri, 10 Jul 2015 02:10:33 -0700 (PDT)
X-Google-Sender-Auth Em1_0E_wYpk4F-WVhaosCSt6_4U
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 45
Organization linux.* mail to news gateway
X-Original-Cc "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Linux-Arch <linux-arch@vger.kernel.org>, Richard Henderson <rth@twiddle.net>, Vineet Gupta <vgupta@synopsys.com>, Russell King <linux@arm.linux.org.uk>, Will Deacon <will.deacon@arm.com>, HÃ¥vard Skinnemoen <hskinnemoen@gmail.com>, Miao Steven <realmz6@gmail.com>, David Howells <dhowells@redhat.com>, Richard Kuo <rkuo@codeaurora.org>, Tony Luck <tony.luck@intel.com>, James Hogan <james.hogan@imgtec.com>, Ralf Baechle <ralf@linux-mips.org>, "James E.J. Bottomley" <jejb@parisc-linux.org>, Benjamin Herrenschmidt <benh@kernel.crashing.org>, Heiko Carstens <heiko.carstens@de.ibm.com>, "David S. Miller" <davem@davemloft.net>, Chris Metcalf <cmetcalf@ezchip.com>, Ingo Molnar <mingo@kernel.org>
X-Original-Date Fri, 10 Jul 2015 11:10:33 +0200
X-Original-Message-ID <CAMuHMdXePQF9BL7OfTz+=FN5Hg9C=E6hAO8MFQ9Eu_tiK_Q8OA@mail.gmail.com>
X-Original-References <20150709172855.564686637@infradead.org> <20150709175310.229218215@infradead.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1181414

Show key headers only | View raw


Hi Peter,

On Thu, Jul 9, 2015 at 7:29 PM, Peter Zijlstra <peterz@infradead.org> 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/

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


Thread

Re: [RFC][PATCH 23/24] atomic: Collapse all atomic_{set,clear}_mask definitions Geert Uytterhoeven <geert@linux-m68k.org> - 2015-07-10 11:20 +0200
  Re: [RFC][PATCH 23/24] atomic: Collapse all atomic_{set,clear}_mask  definitions Peter Zijlstra <peterz@infradead.org> - 2015-07-10 18:30 +0200
    Re: [RFC][PATCH 23/24] atomic: Collapse all atomic_{set,clear}_mask  definitions Chris Metcalf <cmetcalf@ezchip.com> - 2015-07-10 19:40 +0200

csiph-web