From: Max Filippov Date: Sun, 1 Dec 2013 06:16:56 +0000 (+0400) Subject: xtensa: ISS: avoid simple_strtoul usage X-Git-Tag: next-20131220~88^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d30841d27218f83c5b0e93bc6a0f5fd1acd7cea9;p=karo-tx-linux.git xtensa: ISS: avoid simple_strtoul usage Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- diff --git a/arch/xtensa/platforms/iss/network.c b/arch/xtensa/platforms/iss/network.c index 5ae928275db6..f68cd0232d65 100644 --- a/arch/xtensa/platforms/iss/network.c +++ b/arch/xtensa/platforms/iss/network.c @@ -619,22 +619,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); @@ -647,7 +647,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; }