alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Jerome Brunet <jbrunet@baylibre.com>, alsa-devel@alsa-project.org
Cc: tiwai@suse.de, broonie@kernel.org,
	Lee Jones <lee.jones@linaro.org>,
	Rikard Falkeborn <rikard.falkeborn@gmail.com>
Subject: Re: [PATCH 0/3] ASoC: Clean-up W=1 build warnings​ - part3
Date: Tue, 7 Jul 2020 19:16:58 -0500	[thread overview]
Message-ID: <951676be-fd0a-530a-d57b-d684b93efc70@linux.intel.com> (raw)
In-Reply-To: <1jo8ordshd.fsf@starbuckisacylon.baylibre.com>



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)))

  reply	other threads:[~2020-07-08  0:18 UTC|newest]

Thread overview: 8+ 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 ` [PATCH 2/3] ASoC: meson: axg-pdm: " Pierre-Louis Bossart
2020-07-07 19:23 ` [PATCH 3/3] ASoC: meson: axg-spdifin: " 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 [this message]
2020-07-08  6:31     ` Lee Jones
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=951676be-fd0a-530a-d57b-d684b93efc70@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=lee.jones@linaro.org \
    --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 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).