Skip to contentSkip to conversation

drivers:pci:hotplug Fix simple_strtoul is obsolete, use kstrtoul instead

PATCH In review Bogicevic Sasa 2 participants 2 messages Nov 15, 2015 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers:pci:hotplug Fix simple_strtoul is obsolete, use kstrtoul instead

This fixes messages "simple_strtoul is obsolete, use kstrtoul instead" from checkpatch.pl script

---
 drivers/pci/hotplug/pci_hotplug_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pci/hotplug/pci_hotplug_core.c +3 -3
index d379d49..a1160c8 100644
@@ -103,7 +103,7 @@ static ssize_t power_write_file(struct pci_slot *pci_slot, const char *buf,
 	u8 power;
 	int retval = 0;
 
-	lpower = simple_strtoul(buf, NULL, 10);
+	lpower = kstrtoul(buf, NULL, 10);
 	power = (u8)(lpower & 0xff);
 	dbg("power = %d\n", power);
 
@@ -160,7 +160,7 @@ static ssize_t attention_write_file(struct pci_slot *pci_slot, const char *buf,
 	u8 attention;
 	int retval = 0;
 
-	lattention = simple_strtoul(buf, NULL, 10);
+	lattention = kstrtoul(buf, NULL, 10);
 	attention = (u8)(lattention & 0xff);
 	dbg(" - attention = %d\n", attention);
 
@@ -226,7 +226,7 @@ static ssize_t test_write_file(struct pci_slot *pci_slot, const char *buf,
 	u32 test;
 	int retval = 0;
 
-	ltest = simple_strtoul(buf, NULL, 10);
+	ltest = kstrtoul(buf, NULL, 10);
 	test = (u32)(ltest & 0xffffffff);
 	dbg("test = %d\n", test);
 
Signature · 1 line
2.1.4
#1 lore raw
Quoted 13 lines · Bogicevic Sasa

This fixes messages "simple_strtoul is obsolete, use kstrtoul instead" from checkpatch.pl script

---
 drivers/pci/hotplug/pci_hotplug_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pci/hotplug/pci_hotplug_core.c +0 -0
index d379d49..a1160c8 100644

drivers/pci/hotplug/pci_hotplug_core.c static ssize_t power_write_file(struct pci_slot *pci_slot, const char *buf, · line 106

Quoted 5 lines
drivers/pci/hotplug/pci_hotplug_core.c +1 -1
@@ -103,7 +103,7 @@ static ssize_t power_write_file(struct pci_slot *pci_slot, const char *buf,
 	u8 power;
 	int retval = 0;
 
-	lpower = simple_strtoul(buf, NULL, 10);
+	lpower = kstrtoul(buf, NULL, 10);

I take it you did not test this code, since it would probably result in a crash. Does it even compile ?

Hint: When replacing one function call with another, it helps updating the parameters.

Guenter