public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Marco Felsch <m.felsch@pengutronix.de>,
	Frieder Schrempf <frieder.schrempf@exceet.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: work around clang bug in SPI_BPW_RANGE_MASK()
Date: Thu, 7 Mar 2019 11:23:16 +0000	[thread overview]
Message-ID: <20190307112316.GD6529@sirena.org.uk> (raw)
In-Reply-To: <20190307105619.2780591-1-arnd@arndb.de>

[-- Attachment #1: Type: text/plain, Size: 568 bytes --]

On Thu, Mar 07, 2019 at 11:56:07AM +0100, Arnd Bergmann wrote:

> Link: https://bugs.llvm.org/show_bug.cgi?id=38789

>  #define SPI_BPW_MASK(bits) BIT((bits) - 1)
> -#define SPI_BIT_MASK(bits) (((bits) == 32) ? ~0U : (BIT(bits) - 1))
> -#define SPI_BPW_RANGE_MASK(min, max) (SPI_BIT_MASK(max) - SPI_BIT_MASK(min - 1))
> +#define SPI_BIT_MASK(bits) ((BIT((bits) - 1) << 1) - 1)
> +#define SPI_BPW_RANGE_MASK(min, max) (SPI_BIT_MASK(max) - (BIT((min) - 1) - 1))

Can we have a comment that this is for the clang warning please so
nobody goes in and simplifies the code?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-03-07 11:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 10:56 [PATCH] spi: work around clang bug in SPI_BPW_RANGE_MASK() Arnd Bergmann
2019-03-07 11:23 ` Mark Brown [this message]
2019-03-07 13:09 ` Rasmus Villemoes
2019-03-07 13:22   ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190307112316.GD6529@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bbrezillon@kernel.org \
    --cc=frieder.schrempf@exceet.de \
    --cc=geert@linux-m68k.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=ndesaulniers@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox