Commit 8be54d77 authored by Max Filippov's avatar Max Filippov Committed by Chris Zankel

xtensa: ISS: avoid simple_strtoul usage

Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
Signed-off-by: default avatarChris Zankel <chris@zankel.net>
parent 3ade4f81
...@@ -612,22 +612,22 @@ static int __init iss_net_setup(char *str) ...@@ -612,22 +612,22 @@ static int __init iss_net_setup(char *str)
struct iss_net_init *new; struct iss_net_init *new;
struct list_head *ele; struct list_head *ele;
char *end; char *end;
int n; int rc;
unsigned n;
n = simple_strtoul(str, &end, 0); end = strchr(str, '=');
if (end == str) { if (!end) {
printk(ERR "Failed to parse '%s'\n", str); printk(ERR "Expected '=' after device number\n");
return 1; return 1;
} }
if (n < 0) { *end = 0;
printk(ERR "Device %d is negative\n", n); rc = kstrtouint(str, 0, &n);
*end = '=';
if (rc < 0) {
printk(ERR "Failed to parse '%s'\n", str);
return 1; return 1;
} }
str = end; str = end;
if (*str != '=') {
printk(ERR "Expected '=' after device number\n");
return 1;
}
spin_lock(&devices_lock); spin_lock(&devices_lock);
...@@ -640,7 +640,7 @@ static int __init iss_net_setup(char *str) ...@@ -640,7 +640,7 @@ static int __init iss_net_setup(char *str)
spin_unlock(&devices_lock); spin_unlock(&devices_lock);
if (device && device->index == n) { if (device && device->index == n) {
printk(ERR "Device %d already configured\n", n); printk(ERR "Device %u already configured\n", n);
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment