linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] ASoC: meson: axg-pdm: remove comparison always false warning
       [not found] <20200707192310.98663-1-pierre-louis.bossart@linux.intel.com>
@ 2020-07-07 19:23 ` Pierre-Louis Bossart
  2020-07-07 19:23 ` [PATCH 3/3] ASoC: meson: axg-spdifin: " Pierre-Louis Bossart
  1 sibling, 0 replies; 2+ messages in thread
From: Pierre-Louis Bossart @ 2020-07-07 19:23 UTC (permalink / raw)
  To: alsa-devel
  Cc: open list, tiwai, Kevin Hilman, Takashi Iwai, Liam Girdwood,
	Pierre-Louis Bossart, broonie,
	open list:ARM/Amlogic Meson SoC support, Jaroslav Kysela,
	Lee Jones, moderated list:ARM/Amlogic Meson SoC support,
	Jerome Brunet

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(-)

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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 3/3] ASoC: meson: axg-spdifin: remove comparison always false warning
       [not found] <20200707192310.98663-1-pierre-louis.bossart@linux.intel.com>
  2020-07-07 19:23 ` [PATCH 2/3] ASoC: meson: axg-pdm: remove comparison always false warning Pierre-Louis Bossart
@ 2020-07-07 19:23 ` Pierre-Louis Bossart
  1 sibling, 0 replies; 2+ messages in thread
From: Pierre-Louis Bossart @ 2020-07-07 19:23 UTC (permalink / raw)
  To: alsa-devel
  Cc: open list, tiwai, Kevin Hilman, Takashi Iwai, Liam Girdwood,
	Pierre-Louis Bossart, broonie,
	open list:ARM/Amlogic Meson SoC support, Jaroslav Kysela,
	Lee Jones, moderated list:ARM/Amlogic Meson SoC support,
	Jerome Brunet

Fix W=1 warning:

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

Cast width 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-spdifin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/meson/axg-spdifin.c b/sound/soc/meson/axg-spdifin.c
index d0d09f945b48..5fa411d4e985 100644
--- a/sound/soc/meson/axg-spdifin.c
+++ b/sound/soc/meson/axg-spdifin.c
@@ -154,7 +154,7 @@ static void axg_spdifin_write_mode_param(struct regmap *map, int mode,
 	reg = offset * regmap_get_reg_stride(map) + base_reg;
 	shift = width * (num_per_reg - 1 - rem);
 
-	regmap_update_bits(map, reg, GENMASK(width - 1, 0) << shift,
+	regmap_update_bits(map, reg, GENMASK((int)width - 1, 0) << shift,
 			   val << shift);
 }
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-07 19:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200707192310.98663-1-pierre-louis.bossart@linux.intel.com>
2020-07-07 19:23 ` [PATCH 2/3] ASoC: meson: axg-pdm: remove comparison always false warning Pierre-Louis Bossart
2020-07-07 19:23 ` [PATCH 3/3] ASoC: meson: axg-spdifin: " Pierre-Louis Bossart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).