summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorAlviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>2022-03-15 00:18:48 +0000
committerMark Brown <broonie@kernel.org>2022-03-15 12:03:49 +0000
commita8ae15ead9c9d10671c3f76cb0749dec6e571ce7 (patch)
tree24fa496d647966cb3beea2354c1d2d5353971409 /sound
parent910f42bfe96783fc633196bd975731a420c7a066 (diff)
downloadlinux-a8ae15ead9c9d10671c3f76cb0749dec6e571ce7.tar.bz2
ASoC: atmel: mchp-pdmc: Fix `-Wpointer-bool-conversion` warning
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. Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org> Link: https://lore.kernel.org/r/20220315001848.3763534-1-alviro.iskandar@gnuweeb.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/atmel/mchp-pdmc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/atmel/mchp-pdmc.c b/sound/soc/atmel/mchp-pdmc.c
index 1be4007875f1..e0aec5fe8a26 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;