[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190307112316.GD6529@sirena.org.uk>
Date: Thu, 7 Mar 2019 11:23:16 +0000
From: Mark Brown <broonie@...nel.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: Nick Desaulniers <ndesaulniers@...gle.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Boris Brezillon <bbrezillon@...nel.org>,
Marco Felsch <m.felsch@...gutronix.de>,
Frieder Schrempf <frieder.schrempf@...eet.de>,
Linus Walleij <linus.walleij@...aro.org>,
linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] spi: work around clang bug in SPI_BPW_RANGE_MASK()
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?
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists