diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2013-12-01 10:16:56 +0400 |
---|---|---|
committer | Chris Zankel <chris@zankel.net> | 2014-01-14 10:20:00 -0800 |
commit | 8be54d770bcf6f7b203a705aefed2ec845e1b748 (patch) | |
tree | e914004ad77fbb33437624a1ab8b5b51148dd82c /arch | |
parent | 3ade4f81ae0c32c0c82fad93de92df07f24a85a4 (diff) | |
download | linux-8be54d770bcf6f7b203a705aefed2ec845e1b748.tar.bz2 |
xtensa: ISS: avoid simple_strtoul usage
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/xtensa/platforms/iss/network.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/xtensa/platforms/iss/network.c b/arch/xtensa/platforms/iss/network.c index 3aff4302f938..7f84b5c68123 100644 --- a/arch/xtensa/platforms/iss/network.c +++ b/arch/xtensa/platforms/iss/network.c @@ -612,22 +612,22 @@ static int __init iss_net_setup(char *str) struct iss_net_init *new; struct list_head *ele; char *end; - int n; + int rc; + unsigned n; - n = simple_strtoul(str, &end, 0); - if (end == str) { - printk(ERR "Failed to parse '%s'\n", str); + end = strchr(str, '='); + if (!end) { + printk(ERR "Expected '=' after device number\n"); return 1; } - if (n < 0) { - printk(ERR "Device %d is negative\n", n); + *end = 0; + rc = kstrtouint(str, 0, &n); + *end = '='; + if (rc < 0) { + printk(ERR "Failed to parse '%s'\n", str); return 1; } str = end; - if (*str != '=') { - printk(ERR "Expected '=' after device number\n"); - return 1; - } spin_lock(&devices_lock); @@ -640,7 +640,7 @@ static int __init iss_net_setup(char *str) spin_unlock(&devices_lock); if (device && device->index == n) { - printk(ERR "Device %d already configured\n", n); + printk(ERR "Device %u already configured\n", n); return 1; } |