Skip to contentSkip to conversation

x86: kernel/pci-calgary_64.c simple_strtoul cleanup

PATCH In review Shuah Khan 2 participants 3 messages May 20, 2012 – May 21, 2012 x86

lore
Share & tools
lore

Shuah Khan

author
#0 lore raw

PATCH 1/1 x86: kernel/pci-calgary_64.c simple_strtoul cleanup

Change calgary_parse_options() to call kstrtoul() instead of calling obsoleted simple_strtoul().

---
 arch/x86/kernel/pci-calgary_64.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
arch/x86/kernel/pci-calgary_64.c +5 -3
index d0b2fb9..b72838b 100644
@@ -1480,8 +1480,9 @@ cleanup:
 static int __init calgary_parse_options(char *p)
 {
 	unsigned int bridge;
+	unsigned long val;
 	size_t len;
-	char* endp;
+	ssize_t ret;
 
 	while (*p) {
 		if (!strncmp(p, "64k", 3))
@@ -1512,10 +1513,11 @@ static int __init calgary_parse_options(char *p)
 				++p;
 			if (*p == '\0')
 				break;
-			bridge = simple_strtoul(p, &endp, 0);
-			if (p == endp)
+			ret = kstrtoul(p, 0, &val);
+			if (ret)
 				break;
 
+			bridge = val;
 			if (bridge < MAX_PHB_BUS_NUM) {
 				printk(KERN_INFO "Calgary: disabling "
 				       "translation for PHB %#x\n", bridge);
Signature · 1 line
1.7.9.5
#2 lore raw

[tip:x86/cleanups] x86/pci-calgary_64.c: Remove obsoleted simple_strtoul() usage

In reply to Shuah Khan
Commit-ID:  74bc491795420254f8b9c782ec654c9ba005d3ac
Gitweb:     http://git.kernel.org/tip/74bc491795420254f8b9c782ec654c9ba005d3ac
Author:     Shuah Khan <[email protected]>
AuthorDate: Sun, 20 May 2012 17:24:28 -0600
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 21 May 2012 10:29:40 +0200

x86/pci-calgary_64.c: Remove obsoleted simple_strtoul() usage

Change calgary_parse_options() to call kstrtoul() instead of calling obsoleted simple_strtoul().

---
 arch/x86/kernel/pci-calgary_64.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
arch/x86/kernel/pci-calgary_64.c +5 -3
index 6ac5782..dbbfb26 100644
@@ -1479,8 +1479,9 @@ cleanup:
 static int __init calgary_parse_options(char *p)
 {
 	unsigned int bridge;
+	unsigned long val;
 	size_t len;
-	char* endp;
+	ssize_t ret;
 
 	while (*p) {
 		if (!strncmp(p, "64k", 3))
@@ -1511,10 +1512,11 @@ static int __init calgary_parse_options(char *p)
 				++p;
 			if (*p == '\0')
 				break;
-			bridge = simple_strtoul(p, &endp, 0);
-			if (p == endp)
+			ret = kstrtoul(p, 0, &val);
+			if (ret)
 				break;
 
+			bridge = val;
 			if (bridge < MAX_PHB_BUS_NUM) {
 				printk(KERN_INFO "Calgary: disabling "
 				       "translation for PHB %#x\n", bridge);