mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers:pci:hotplug Fix  simple_strtoul is obsolete, use kstrtoul instead
@ 2015-11-15 12:43 Bogicevic Sasa
  2015-11-15 16:11 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Bogicevic Sasa @ 2015-11-15 12:43 UTC (permalink / raw)
  To: bhelgaas; +Cc: wangyijing, linux-pci, linux-kernel, Bogicevic Sasa

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

Signed-off-by: Bogicevic Sasa <brutallesale@gmail.com>
---
 drivers/pci/hotplug/pci_hotplug_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
index d379d49..a1160c8 100644
--- a/drivers/pci/hotplug/pci_hotplug_core.c
+++ b/drivers/pci/hotplug/pci_hotplug_core.c
@@ -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);
 
-- 
2.1.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers:pci:hotplug Fix  simple_strtoul is obsolete, use kstrtoul instead
  2015-11-15 12:43 [PATCH] drivers:pci:hotplug Fix simple_strtoul is obsolete, use kstrtoul instead Bogicevic Sasa
@ 2015-11-15 16:11 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2015-11-15 16:11 UTC (permalink / raw)
  To: Bogicevic Sasa; +Cc: bhelgaas, wangyijing, linux-pci, linux-kernel

On Sun, Nov 15, 2015 at 01:43:55PM +0100, Bogicevic Sasa wrote:
> This fixes messages "simple_strtoul is obsolete, use kstrtoul instead"
> from checkpatch.pl script
> 
> Signed-off-by: Bogicevic Sasa <brutallesale@gmail.com>
> ---
>  drivers/pci/hotplug/pci_hotplug_core.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
> index d379d49..a1160c8 100644
> --- a/drivers/pci/hotplug/pci_hotplug_core.c
> +++ b/drivers/pci/hotplug/pci_hotplug_core.c
> @@ -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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-15 16:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-15 12:43 [PATCH] drivers:pci:hotplug Fix simple_strtoul is obsolete, use kstrtoul instead Bogicevic Sasa
2015-11-15 16:11 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®