From: Lee Jones <lee.jones@linaro.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org, broonie@kernel.org,
Rikard Falkeborn <rikard.falkeborn@gmail.com>,
Jerome Brunet <jbrunet@baylibre.com>
Subject: Re: [PATCH 0/3] ASoC: Clean-up W=1 build warnings - part3
Date: Wed, 8 Jul 2020 07:31:00 +0100 [thread overview]
Message-ID: <20200708063100.GH3500@dell> (raw)
In-Reply-To: <951676be-fd0a-530a-d57b-d684b93efc70@linux.intel.com>
On Tue, 07 Jul 2020, Pierre-Louis Bossart wrote:
> On 7/7/20 2:39 PM, Jerome Brunet wrote:
> >
> > On Tue 07 Jul 2020 at 21:23, Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> wrote:
> >
> > > This is a much smaller set of cleanups, all related to warnings thrown
> > > by the use of GENMASK() with an unsigned variable. I just made the
> > > warning go away but I wonder if there's a better fix in the definition
> > > of GENMASK() itself?
> >
> > Looking at the patch I was going to ask the same thing.
> > It does not make much sense to me to force GENMASK arguments to be
> > integer (instead of unsigned integer) to then check there are positive ...
>
> Agree, it's just that the following macro isn't exactly simple to change:
>
> #define GENMASK_INPUT_CHECK(h, l) \
> (BUILD_BUG_ON_ZERO(__builtin_choose_expr( \
> __builtin_constant_p((l) > (h)), (l) > (h), 0)))
>
> I couldn't find a means to avoid the comparison.
>
> I just realized this is a fairly recent addition in 295bcca84916
> ('linux/bits.h: add compile time sanity check of GENMASK inputs'), adding
> the author Rikard Falkeborn in CC:
>
> include/linux/bits.h:26:28: warning: comparison of unsigned expression < 0
> is always false [-Wtype-limits]
> 26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
Linus recently complained about the type-limits warning, saying that
it was invalid. He preferred the warning to be bumped from W=1 to
W=2, although I haven't seen a patch doing this yet.
Rikard also tried to fix GENMASK directly; however, Linus did not
approve of this either.
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2020-07-08 6:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-07 19:23 [PATCH 0/3] ASoC: Clean-up W=1 build warnings - part3 Pierre-Louis Bossart
2020-07-07 19:23 ` [PATCH 1/3] ASoC: Intel: Skylake: remove comparison always false warning Pierre-Louis Bossart
2020-07-07 19:23 ` Pierre-Louis Bossart
2020-07-07 19:23 ` [PATCH 2/3] ASoC: meson: axg-pdm: " Pierre-Louis Bossart
2020-07-07 19:23 ` Pierre-Louis Bossart
2020-07-07 19:23 ` Pierre-Louis Bossart
2020-07-07 19:23 ` Pierre-Louis Bossart
2020-07-07 19:23 ` [PATCH 3/3] ASoC: meson: axg-spdifin: " Pierre-Louis Bossart
2020-07-07 19:23 ` Pierre-Louis Bossart
2020-07-07 19:23 ` Pierre-Louis Bossart
2020-07-07 19:23 ` Pierre-Louis Bossart
2020-07-07 19:39 ` [PATCH 0/3] ASoC: Clean-up W=1 build warnings - part3 Jerome Brunet
2020-07-08 0:16 ` Pierre-Louis Bossart
2020-07-08 6:31 ` Lee Jones [this message]
2020-07-08 11:13 ` Mark Brown
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=20200708063100.GH3500@dell \
--to=lee.jones@linaro.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=jbrunet@baylibre.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=rikard.falkeborn@gmail.com \
--cc=tiwai@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.