aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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