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

Message ID 20200707192310.98663-3-pierre-louis.bossart@linux.intel.com
State New
Headers show
Series
  • ASoC: Clean-up W=1 build warnings��� - part3
Related show

Commit Message

Pierre-Louis Bossart July 7, 2020, 7:23 p.m. UTC
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@linux.intel.com>
---
 sound/soc/meson/axg-pdm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

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,