diff mbox series

[2/5] ASoC: soc-core: fix signed/unsigned issue

Message ID 20210416191144.27006-3-pierre-louis.bossart@linux.intel.com
State Accepted
Commit d3b47a888f0bc66a8590941cfa57ba015b288040
Headers show
Series ASoC: remove more cppcheck warnings | expand

Commit Message

Pierre-Louis Bossart April 16, 2021, 7:11 p.m. UTC
cppcheck warning:

sound/soc/soc-core.c:2237:13: warning: %x in format string (no. 1)
requires 'unsigned int *' but the argument type is 'signed
int *'. [invalidScanfArgType_int]
 } else if (sscanf(name, "%x-%x", &id1, &id2) == 2) {
            ^
sound/soc/soc-core.c:2237:13: warning: %x in format string (no. 2)
requires 'unsigned int *' but the argument type is 'signed
int *'. [invalidScanfArgType_int]
 } else if (sscanf(name, "%x-%x", &id1, &id2) == 2) {
            ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
---
 sound/soc/soc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 236e075b9e57..aee91bde9fb8 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2215,7 +2215,7 @@  static char *fmt_single_name(struct device *dev, int *id)
 {
 	const char *devname = dev_name(dev);
 	char *found, *name;
-	int id1, id2;
+	unsigned int id1, id2;
 
 	if (devname == NULL)
 		return NULL;