Content-Type: multipart/mixed; boundary="===============5892461002155806070==" MIME-Version: 1.0 From: Alviro Iskandar Setiawan To: kbuild-all@lists.01.org Subject: [PATCH] ASoC: atmel: mchp-pdmc: Fix `-Wpointer-bool-conversion` warning Date: Wed, 09 Mar 2022 06:58:49 +0000 Message-ID: <20220309065849.96165-1-alviro.iskandar@gnuweeb.org> In-Reply-To: <202203091430.MLY27Bif-lkp@intel.com> List-Id: --===============5892461002155806070== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Cc: Codrin Ciubotariu Cc: Nugraha Cc: llvm(a)lists.linux.dev Cc: kbuild-all(a)lists.01.org Cc: gwml(a)vger.gnuweeb.org Cc: linux-kernel(a)vger.kernel.org Reported-by: kernel test robot Link: https://lore.kernel.org/lkml/202203091430.MLY27Bif-lkp(a)intel.com Fixes: 50291652af5269813baa6024eb0e81b5f0bbb451 ("ASoC: atmel: mchp-pdmc: a= dd PDMC driver") Signed-off-by: Alviro Iskandar Setiawan --- 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 *kcontr= ol, { struct snd_soc_component *component =3D snd_kcontrol_chip(kcontrol); struct mchp_pdmc *dd =3D snd_soc_component_get_drvdata(component); - bool af =3D uvalue->value.integer.value ? true : false; + bool af =3D uvalue->value.integer.value[0] ? true : false; = if (dd->audio_filter_en =3D=3D af) return 0; base-commit: 50291652af5269813baa6024eb0e81b5f0bbb451 -- = 2.27.0 --===============5892461002155806070==--