Thread (1 message) read the whole thread 1 message, 1 author, 2021-03-26
STALE1948d LANDED

Landed in mainline as 11033e51b316 on 2021-03-31.

[PATCH 10/17] ASoC: stm: stm32_adfsdm: fix snprintf format string

From: Pierre-Louis Bossart <hidden>
Date: 2021-03-26 22:01:10
Also in: alsa-devel, lkml
Subsystem: sound, sound - soc layer / dynamic audio power management (asoc), stm32 audio (asoc) drivers, the rest · Maintainers: Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown, Olivier Moysan, Arnaud Pouliquen, Linus Torvalds

cppcheck warning:

sound/soc/stm/stm32_adfsdm.c:120:2: warning: %d in format
string (no. 1) requires 'int' but the argument type is 'unsigned
int'. [invalidPrintfArgType_sint]
 snprintf(str_freq, sizeof(str_freq), "%d\n", freq);
 ^

Signed-off-by: Pierre-Louis Bossart <redacted>
---
 sound/soc/stm/stm32_adfsdm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/stm/stm32_adfsdm.c b/sound/soc/stm/stm32_adfsdm.c
index 47fae8dd20b4..e6078f50e508 100644
--- a/sound/soc/stm/stm32_adfsdm.c
+++ b/sound/soc/stm/stm32_adfsdm.c
@@ -117,7 +117,7 @@ static int stm32_adfsdm_set_sysclk(struct snd_soc_dai *dai, int clk_id,
 
 	/* Set IIO frequency if CODEC is master as clock comes from SPI_IN */
 
-	snprintf(str_freq, sizeof(str_freq), "%d\n", freq);
+	snprintf(str_freq, sizeof(str_freq), "%u\n", freq);
 	size = iio_write_channel_ext_info(priv->iio_ch, "spi_clk_freq",
 					  str_freq, sizeof(str_freq));
 	if (size != sizeof(str_freq)) {
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help