]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: atmel: mchp-pdmc: Fix `-Wpointer-bool-conversion` warning
authorAlviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
Tue, 15 Mar 2022 00:18:48 +0000 (00:18 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 15 Mar 2022 12:03:49 +0000 (12:03 +0000)
commit4fcd311e97b8b4d3a6441a0fb6399d7dad0cb45f
tree24fa496d647966cb3beea2354c1d2d5353971409
parent2e6210c2a4c9366e2435e639342e2aeea3a48ddb
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>
sound/soc/atmel/mchp-pdmc.c