[PATCH 2/3] ASoC: meson: axg-pdm: remove comparison always false warning

From: Pierre-Louis Bossart
Date: Tue Jul 07 2020 - 15:23:32 EST


Fix W=1 warning.

sound/soc/meson/axg-pdm.c: In function âaxg_pdm_set_channel_maskâ:
include/linux/bits.h:26:28: warning: comparison of unsigned expression
< 0 is always false [-Wtype-limits]

cast the channel number to an int to avoid checking if an unsigned
value is lower than zero.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx>
---
sound/soc/meson/axg-pdm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/meson/axg-pdm.c b/sound/soc/meson/axg-pdm.c
index bfd37d49a73e..8fe5b2563619 100644
--- a/sound/soc/meson/axg-pdm.c
+++ b/sound/soc/meson/axg-pdm.c
@@ -206,7 +206,7 @@ static int axg_pdm_set_sample_pointer(struct axg_pdm *priv)
static void axg_pdm_set_channel_mask(struct axg_pdm *priv,
unsigned int channels)
{
- unsigned int mask = GENMASK(channels - 1, 0);
+ unsigned int mask = GENMASK((int)channels - 1, 0);

/* Put all channel in reset */
regmap_update_bits(priv->map, PDM_CTRL,
--
2.25.1