Skip to contentSkip to conversation

fix format string mismatch in arch/sparc/kernel/sysfs.c

PATCH New Sam Ravnborg 3 participants 4 messages May 18, 2014 – May 21, 2014 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore

Sam Ravnborg

author Acked-by
#0 lore raw
Quoted 3 lines · Toralf Förster

found by cppcheck

[Toralf - fist mail was accidently only sent to
you - something looks fishy in the To: line of your mail]

Quoted 20 lines
---
 arch/sparc/kernel/sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sparc/kernel/sysfs.c +1 -1
index a364000..7f41d40 100644
@@ -151,7 +151,7 @@ static ssize_t store_mmustat_enable(struct device *s,
 			size_t count)
 {
 	unsigned long val, err;
-	int ret = sscanf(buf, "%ld", &val);
+	int ret = sscanf(buf, "%lu", &val);
 
 	if (ret != 1)
 		return -EINVAL;
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/1 fix format string mismatch in arch/sparc/kernel/sysfs.c

found by cppcheck

---
 arch/sparc/kernel/sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sparc/kernel/sysfs.c +1 -1
index a364000..7f41d40 100644
@@ -151,7 +151,7 @@ static ssize_t store_mmustat_enable(struct device *s,
 			size_t count)
 {
 	unsigned long val, err;
-	int ret = sscanf(buf, "%ld", &val);
+	int ret = sscanf(buf, "%lu", &val);
 
 	if (ret != 1)
 		return -EINVAL;
Signature · 1 line
1.9.3
author Acked-by
#2 lore raw
In reply to Sam Ravnborg
Quoted 3 lines · Toralf Förster

found by cppcheck

Quoted 20 lines
---
 arch/sparc/kernel/sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sparc/kernel/sysfs.c +1 -1
index a364000..7f41d40 100644
@@ -151,7 +151,7 @@ static ssize_t store_mmustat_enable(struct device *s,
 			size_t count)
 {
 	unsigned long val, err;
-	int ret = sscanf(buf, "%ld", &val);
+	int ret = sscanf(buf, "%lu", &val);
 
 	if (ret != 1)
 		return -EINVAL;
Signature · 1 line
1.9.3