Skip to contentSkip to conversation

x86: kernel/microcode_core.c simple_strtoul cleanup

PATCH Superseded Shuah Khan 2 participants 3 messages May 5, 2012 – May 6, 2012 x86

lore
Share & tools
lore

Shuah Khan

author
#0 lore raw

PATCH 1/1 x86: kernel/microcode_core.c simple_strtoul cleanup

Change reload_for_cpu() in kernel/microcode_core.c to call kstrtoul() instead of calling obsoleted simple_strtoul().

Quoted 1 line

From 8df8b8f87a8e462faa7b4c2b4682b23df5afa4bd Mon Sep 17 00:00:00 2001

From: Shuah Khan <[email protected]>
Date: Fri, 4 May 2012 14:12:11 -0600
Subject: [PATCH] x86: kernel/microcode_core.c simple_strtoul cleanup

---
 arch/x86/kernel/microcode_core.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
arch/x86/kernel/microcode_core.c +4 -5
index c9bda6d..fbdfc69 100644
@@ -299,12 +299,11 @@ static ssize_t reload_store(struct device *dev,
 {
 	unsigned long val;
 	int cpu = dev->id;
-	int ret = 0;
-	char *end;
+	ssize_t ret = 0;
 
-	val = simple_strtoul(buf, &end, 0);
-	if (end == buf)
-		return -EINVAL;
+	ret = kstrtoul(buf, 0, &val);
+	if (ret)
+		return ret;
 
 	if (val == 1) {
 		get_online_cpus();
Signature · 1 line
1.7.9.5
maintainer
#1 lore raw
Quoted 37 lines · Shuah Khan

Change reload_for_cpu() in kernel/microcode_core.c to call kstrtoul() instead of calling obsoleted simple_strtoul().

From 8df8b8f87a8e462faa7b4c2b4682b23df5afa4bd Mon Sep 17 00:00:00 2001
From: Shuah Khan <[email protected]>
Date: Fri, 4 May 2012 14:12:11 -0600
Subject: [PATCH] x86: kernel/microcode_core.c simple_strtoul cleanup

---
 arch/x86/kernel/microcode_core.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
arch/x86/kernel/microcode_core.c +4 -5
index c9bda6d..fbdfc69 100644
@@ -299,12 +299,11 @@ static ssize_t reload_store(struct device *dev,
 {
 	unsigned long val;
 	int cpu = dev->id;
-	int ret = 0;
-	char *end;
+	ssize_t ret = 0;
 
-	val = simple_strtoul(buf, &end, 0);
-	if (end == buf)
-		return -EINVAL;
+	ret = kstrtoul(buf, 0, &val);
+	if (ret)
+		return ret;
 
 	if (val == 1) {
 		get_online_cpus();
Signature · 1 line
1.7.9.5

Patch looks correct but your patch format looks all flipped: first you have the commit message and then the mail headers you get from git format-patch, what happened? IOW, it should be the other way around.

Go look at other messages on lkml starting with "tip-bot" in the From:
for a proper patch formatting pls.

Thanks.

Signature · 2 lines
Regards/Gruss,
    Boris.
author
#2 lore raw

Sorry - will resend the patch tagged RESEND.

-- Shuah