aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/platforms/iss/network.c
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2013-12-01 01:16:56 -0500
committerChris Zankel <chris@zankel.net>2014-01-14 13:20:00 -0500
commit8be54d770bcf6f7b203a705aefed2ec845e1b748 (patch)
treee914004ad77fbb33437624a1ab8b5b51148dd82c /arch/xtensa/platforms/iss/network.c
parent3ade4f81ae0c32c0c82fad93de92df07f24a85a4 (diff)
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/xtensa/platforms/iss/network.c')
-rw-r--r--arch/xtensa/platforms/iss/network.c22
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)
612 struct iss_net_init *new; 612 struct iss_net_init *new;
613 struct list_head *ele; 613 struct list_head *ele;
614 char *end; 614 char *end;
615 int n; 615 int rc;
616 unsigned n;
616 617
617 n = simple_strtoul(str, &end, 0); 618 end = strchr(str, '=');
618 if (end == str) { 619 if (!end) {
619 printk(ERR "Failed to parse '%s'\n", str); 620 printk(ERR "Expected '=' after device number\n");
620 return 1; 621 return 1;
621 } 622 }
622 if (n < 0) { 623 *end = 0;
623 printk(ERR "Device %d is negative\n", n); 624 rc = kstrtouint(str, 0, &n);
625 *end = '=';
626 if (rc < 0) {
627 printk(ERR "Failed to parse '%s'\n", str);
624 return 1; 628 return 1;
625 } 629 }
626 str = end; 630 str = end;
627 if (*str != '=') {
628 printk(ERR "Expected '=' after device number\n");
629 return 1;
630 }
631 631
632 spin_lock(&devices_lock); 632 spin_lock(&devices_lock);
633 633
@@ -640,7 +640,7 @@ static int __init iss_net_setup(char *str)
640 spin_unlock(&devices_lock); 640 spin_unlock(&devices_lock);
641 641
642 if (device && device->index == n) { 642 if (device && device->index == n) {
643 printk(ERR "Device %d already configured\n", n); 643 printk(ERR "Device %u already configured\n", n);
644 return 1; 644 return 1;
645 } 645 }
646 646