lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yi+8ft7yXrNN4+Yx@dev-arch.thelio-3990X>
Date:   Mon, 14 Mar 2022 15:06:54 -0700
From:   Nathan Chancellor <nathan@...nel.org>
To:     Alviro Iskandar Setiawan <alviro.iskandar@...weeb.org>
Cc:     Mark Brown <broonie@...nel.org>,
        Alviro Iskandar Setiawan <alviro.iskandar@...il.com>,
        Codrin Ciubotariu <codrin.ciubotariu@...rochip.com>,
        Nugraha <richiisei@...il.com>, llvm@...ts.linux.dev,
        kbuild-all@...ts.01.org, gwml@...r.gnuweeb.org,
        linux-kernel@...r.kernel.org, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] ASoC: atmel: mchp-pdmc: Fix `-Wpointer-bool-conversion`
 warning

Hi Alviro,

On Wed, Mar 09, 2022 at 06:58:49AM +0000, Alviro Iskandar Setiawan wrote:
> In function mchp_pdmc_af_put(), Intel's kernel test robot reports the
> following warning:
> 
>   sound/soc/atmel/mchp-pdmc.c:186:34: warning: address of array \
>   'uvalue->value.integer.value' will always evaluate to 'true' \
>   [-Wpointer-bool-conversion]
> 
> This is because we are using `uvalue->value.integer.value` which its
> type is `long value[128];` for conditional expression and that array
> will always decay to a non-NULL pointer. Using a non-NULL pointer for
> conditional expression will always evaluate to true.
> 
> Fix this by changing it to `uvalue->value.integer.value[0]` as that's
> what the mchp_pdmc_af_get() function sets.
> 
> To: Mark Brown <broonie@...nel.org>
> Cc: Codrin Ciubotariu <codrin.ciubotariu@...rochip.com>
> Cc: Nugraha <richiisei@...il.com>
> Cc: llvm@...ts.linux.dev
> Cc: kbuild-all@...ts.01.org
> Cc: gwml@...r.gnuweeb.org
> Cc: linux-kernel@...r.kernel.org

I would recommend removing these and just setting those values via git
send-email flags. In other words:

git send-email --to "..." --cc "..." --cc "..." <path to .patch>

and so on. It can cause a lot of spam if this patch is ever backported
or needed in other trees.

> Reported-by: kernel test robot <lkp@...el.com>
> Link: https://lore.kernel.org/lkml/202203091430.MLY27Bif-lkp@intel.com
> Fixes: 50291652af5269813baa6024eb0e81b5f0bbb451 ("ASoC: atmel: mchp-pdmc: add PDMC driver")

This should be simplified to:

Fixes: 50291652af52 ("ASoC: atmel: mchp-pdmc: add PDMC driver")

I don't think the automated checkers will complain about that but the
short form is preferred.

> Signed-off-by: Alviro Iskandar Setiawan <alviro.iskandar@...weeb.org>

Thanks a lot for the patch!

Reviewed-by: Nathan Chancellor <nathan@...nel.org>

I don't know if those nits are worth resending but I do not see this
applied to Mark's tree yet. It might have gotten lost because this was
sent as a reply to the build report, rather than its own thread, which
has caused issues for me in the past:

https://lore.kernel.org/r/20210903162639.GM4932@sirena.org.uk/

If there is no action on this patch in the next couple of days, please
consider resending with the above nits addressed with Codrin's tag and
my tag.

> ---
>  sound/soc/atmel/mchp-pdmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/atmel/mchp-pdmc.c b/sound/soc/atmel/mchp-pdmc.c
> index c44636f6207d..7b87f75c284c 100644
> --- a/sound/soc/atmel/mchp-pdmc.c
> +++ b/sound/soc/atmel/mchp-pdmc.c
> @@ -183,7 +183,7 @@ static int mchp_pdmc_af_put(struct snd_kcontrol *kcontrol,
>  {
>  	struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
>  	struct mchp_pdmc *dd = snd_soc_component_get_drvdata(component);
> -	bool af = uvalue->value.integer.value ? true : false;
> +	bool af = uvalue->value.integer.value[0] ? true : false;
>  
>  	if (dd->audio_filter_en == af)
>  		return 0;
> 
> base-commit: 50291652af5269813baa6024eb0e81b5f0bbb451
> -- 
> 2.27.0
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ