* [ammarfaizi2-block:broonie/sound/for-next 13916/13921] sound/soc/atmel/mchp-pdmc.c:186:34: warning: address of array 'uvalue->value.integer.value' will always evaluate to 'true'
@ 2022-03-09 6:09 kernel test robot
2022-03-09 6:58 ` [PATCH] ASoC: atmel: mchp-pdmc: Fix `-Wpointer-bool-conversion` warning Alviro Iskandar Setiawan
0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2022-03-09 6:09 UTC (permalink / raw)
To: Codrin Ciubotariu
Cc: llvm, kbuild-all, GNU/Weeb Mailing List, linux-kernel, Mark Brown
tree: https://github.com/ammarfaizi2/linux-block broonie/sound/for-next
head: 0b7daa6bd0a4cab3b0c6f266a8cb1344ce14ef19
commit: 50291652af5269813baa6024eb0e81b5f0bbb451 [13916/13921] ASoC: atmel: mchp-pdmc: add PDMC driver
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20220309/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 276ca87382b8f16a65bddac700202924228982f6)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/ammarfaizi2/linux-block/commit/50291652af5269813baa6024eb0e81b5f0bbb451
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block broonie/sound/for-next
git checkout 50291652af5269813baa6024eb0e81b5f0bbb451
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash sound/soc/atmel/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
All warnings (new ones prefixed by >>):
>> sound/soc/atmel/mchp-pdmc.c:186:34: warning: address of array 'uvalue->value.integer.value' will always evaluate to 'true' [-Wpointer-bool-conversion]
bool af = uvalue->value.integer.value ? true : false;
~~~~~~~~~~~~~~~~~~~~~~^~~~~ ~
1 warning generated.
vim +186 sound/soc/atmel/mchp-pdmc.c
180
181 static int mchp_pdmc_af_put(struct snd_kcontrol *kcontrol,
182 struct snd_ctl_elem_value *uvalue)
183 {
184 struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
185 struct mchp_pdmc *dd = snd_soc_component_get_drvdata(component);
> 186 bool af = uvalue->value.integer.value ? true : false;
187
188 if (dd->audio_filter_en == af)
189 return 0;
190
191 dd->audio_filter_en = af;
192
193 return 1;
194 }
195
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ASoC: atmel: mchp-pdmc: Fix `-Wpointer-bool-conversion` warning
2022-03-09 6:09 [ammarfaizi2-block:broonie/sound/for-next 13916/13921] sound/soc/atmel/mchp-pdmc.c:186:34: warning: address of array 'uvalue->value.integer.value' will always evaluate to 'true' kernel test robot
@ 2022-03-09 6:58 ` Alviro Iskandar Setiawan
2022-03-09 7:55 ` Codrin.Ciubotariu
2022-03-14 22:06 ` Nathan Chancellor
0 siblings, 2 replies; 5+ messages in thread
From: Alviro Iskandar Setiawan @ 2022-03-09 6:58 UTC (permalink / raw)
To: Mark Brown
Cc: Alviro Iskandar Setiawan, Alviro Iskandar Setiawan,
Codrin Ciubotariu, Nugraha, llvm, kbuild-all, gwml, linux-kernel,
kernel test robot
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 <[email protected]>
Cc: Codrin Ciubotariu <[email protected]>
Cc: Nugraha <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Reported-by: kernel test robot <[email protected]>
Link: https://lore.kernel.org/lkml/[email protected]
Fixes: 50291652af5269813baa6024eb0e81b5f0bbb451 ("ASoC: atmel: mchp-pdmc: add PDMC driver")
Signed-off-by: Alviro Iskandar Setiawan <[email protected]>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: atmel: mchp-pdmc: Fix `-Wpointer-bool-conversion` warning
2022-03-09 6:58 ` [PATCH] ASoC: atmel: mchp-pdmc: Fix `-Wpointer-bool-conversion` warning Alviro Iskandar Setiawan
@ 2022-03-09 7:55 ` Codrin.Ciubotariu
2022-03-14 22:06 ` Nathan Chancellor
1 sibling, 0 replies; 5+ messages in thread
From: Codrin.Ciubotariu @ 2022-03-09 7:55 UTC (permalink / raw)
To: alviro.iskandar, broonie
Cc: alviro.iskandar, richiisei, llvm, kbuild-all, gwml, linux-kernel,
lkp
On 09.03.2022 08:58, 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 <[email protected]>
> Cc: Codrin Ciubotariu <[email protected]>
> Cc: Nugraha <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Reported-by: kernel test robot <[email protected]>
> Link: https://lore.kernel.org/lkml/[email protected]
> Fixes: 50291652af5269813baa6024eb0e81b5f0bbb451 ("ASoC: atmel: mchp-pdmc: add PDMC driver")
> Signed-off-by: Alviro Iskandar Setiawan <[email protected]>
Reviewed-by: Codrin Ciubotariu <[email protected]>
Thank you!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: atmel: mchp-pdmc: Fix `-Wpointer-bool-conversion` warning
2022-03-09 6:58 ` [PATCH] ASoC: atmel: mchp-pdmc: Fix `-Wpointer-bool-conversion` warning Alviro Iskandar Setiawan
2022-03-09 7:55 ` Codrin.Ciubotariu
@ 2022-03-14 22:06 ` Nathan Chancellor
2022-03-14 23:38 ` Alviro Iskandar Setiawan
1 sibling, 1 reply; 5+ messages in thread
From: Nathan Chancellor @ 2022-03-14 22:06 UTC (permalink / raw)
To: Alviro Iskandar Setiawan
Cc: Mark Brown, Alviro Iskandar Setiawan, Codrin Ciubotariu, Nugraha,
llvm, kbuild-all, gwml, linux-kernel, kernel test robot
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 <[email protected]>
> Cc: Codrin Ciubotariu <[email protected]>
> Cc: Nugraha <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
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 <[email protected]>
> Link: https://lore.kernel.org/lkml/[email protected]
> 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 <[email protected]>
Thanks a lot for the patch!
Reviewed-by: Nathan Chancellor <[email protected]>
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/[email protected]/
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
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: atmel: mchp-pdmc: Fix `-Wpointer-bool-conversion` warning
2022-03-14 22:06 ` Nathan Chancellor
@ 2022-03-14 23:38 ` Alviro Iskandar Setiawan
0 siblings, 0 replies; 5+ messages in thread
From: Alviro Iskandar Setiawan @ 2022-03-14 23:38 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Mark Brown, Codrin Ciubotariu, Nugraha, llvm, kbuild-all,
GNU/Weeb Mailing List, Linux Kernel Mailing List,
kernel test robot, Alviro Iskandar Setiawan
On Tue, Mar 15, 2022 at 5:07 AM Nathan Chancellor wrote:
> Hi Alviro,
[...]
>
> 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.
Fixed.
> > Reported-by: kernel test robot <[email protected]>
> > Link: https://lore.kernel.org/lkml/[email protected]
> > 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.
Fixed.
> > Signed-off-by: Alviro Iskandar Setiawan <[email protected]>
>
> Thanks a lot for the patch!
>
> Reviewed-by: Nathan Chancellor <[email protected]>
>
> 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/[email protected]/
>
> 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.
Will address those. Thanks for the review.
-- Viro
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-03-14 23:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-09 6:09 [ammarfaizi2-block:broonie/sound/for-next 13916/13921] sound/soc/atmel/mchp-pdmc.c:186:34: warning: address of array 'uvalue->value.integer.value' will always evaluate to 'true' kernel test robot
2022-03-09 6:58 ` [PATCH] ASoC: atmel: mchp-pdmc: Fix `-Wpointer-bool-conversion` warning Alviro Iskandar Setiawan
2022-03-09 7:55 ` Codrin.Ciubotariu
2022-03-14 22:06 ` Nathan Chancellor
2022-03-14 23:38 ` Alviro Iskandar Setiawan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox