[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20170803144555.facd691eef60a85bcc06b697@linux-foundation.org>
Date: Thu, 3 Aug 2017 14:45:55 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Matthias Kaehlcke <mka@...omium.org>
Cc: zijun_hu <zijun_hu@....com>, linux-kernel@...r.kernel.org,
Doug Anderson <dianders@...omium.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Greg Hackmann <ghackmann@...gle.com>,
Yury Norov <ynorov@...iumnetworks.com>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>
Subject: Re: [PATCH v2] bitops: Avoid integer overflow in GENMASK(_ULL)
On Thu, 3 Aug 2017 14:20:20 -0700 Matthias Kaehlcke <mka@...omium.org> wrote:
> GENMASK(_ULL) performs a left-shift of ~0UL(L), which technically
> results in an integer overflow. clang raises a warning if the overflow
> occurs in a preprocessor expression.
That's just irritaing.
> Clear the low-order bits through
> a substraction instead of the left-shift to avoid the overflow.
There's no change in .text size for a few files I tested so guess we
can live with it.
Powered by blists - more mailing lists