linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Matthias Kaehlcke <mka@chromium.org>
Cc: zijun_hu <zijun_hu@htc.com>,
	linux-kernel@vger.kernel.org,
	Doug Anderson <dianders@chromium.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Greg Hackmann <ghackmann@google.com>,
	Yury Norov <ynorov@caviumnetworks.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [PATCH v2] bitops: Avoid integer overflow in GENMASK(_ULL)
Date: Thu, 3 Aug 2017 14:45:55 -0700	[thread overview]
Message-ID: <20170803144555.facd691eef60a85bcc06b697@linux-foundation.org> (raw)
In-Reply-To: <20170803212020.24939-1-mka@chromium.org>

On Thu,  3 Aug 2017 14:20:20 -0700 Matthias Kaehlcke <mka@chromium.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.

      reply	other threads:[~2017-08-03 21:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-03 21:20 [PATCH v2] bitops: Avoid integer overflow in GENMASK(_ULL) Matthias Kaehlcke
2017-08-03 21:45 ` Andrew Morton [this message]

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=20170803144555.facd691eef60a85bcc06b697@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=dianders@chromium.org \
    --cc=ghackmann@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=ndesaulniers@google.com \
    --cc=ynorov@caviumnetworks.com \
    --cc=zijun_hu@htc.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;
as well as URLs for NNTP newsgroup(s).