diff options
author | Yinghai Lu <Yinghai.Lu@Sun.COM> | 2007-07-16 02:37:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-16 12:05:34 -0400 |
commit | eaa944afb206f3fc4393630811ee621b866e3255 (patch) | |
tree | 71a68928f5cd5223bb33de0db757f00a00eb2997 /kernel/printk.c | |
parent | 79492689e40d4f4d3d8a7262781d56fb295b4b86 (diff) |
console: more buf for index parsing
Change name to buf according to the usage as name + index
Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Gerd Hoffmann <kraxel@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/printk.c')
-rw-r--r-- | kernel/printk.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index 0bbdeac2810c..4961410ba367 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -654,7 +654,7 @@ static void call_console_drivers(unsigned long start, unsigned long end) | |||
654 | */ | 654 | */ |
655 | static int __init console_setup(char *str) | 655 | static int __init console_setup(char *str) |
656 | { | 656 | { |
657 | char name[sizeof(console_cmdline[0].name)]; | 657 | char buf[sizeof(console_cmdline[0].name) + 4]; /* 4 for index */ |
658 | char *s, *options; | 658 | char *s, *options; |
659 | int idx; | 659 | int idx; |
660 | 660 | ||
@@ -662,27 +662,27 @@ static int __init console_setup(char *str) | |||
662 | * Decode str into name, index, options. | 662 | * Decode str into name, index, options. |
663 | */ | 663 | */ |
664 | if (str[0] >= '0' && str[0] <= '9') { | 664 | if (str[0] >= '0' && str[0] <= '9') { |
665 | strcpy(name, "ttyS"); | 665 | strcpy(buf, "ttyS"); |
666 | strncpy(name + 4, str, sizeof(name) - 5); | 666 | strncpy(buf + 4, str, sizeof(buf) - 5); |
667 | } else { | 667 | } else { |
668 | strncpy(name, str, sizeof(name) - 1); | 668 | strncpy(buf, str, sizeof(buf) - 1); |
669 | } | 669 | } |
670 | name[sizeof(name) - 1] = 0; | 670 | buf[sizeof(buf) - 1] = 0; |
671 | if ((options = strchr(str, ',')) != NULL) | 671 | if ((options = strchr(str, ',')) != NULL) |
672 | *(options++) = 0; | 672 | *(options++) = 0; |
673 | #ifdef __sparc__ | 673 | #ifdef __sparc__ |
674 | if (!strcmp(str, "ttya")) | 674 | if (!strcmp(str, "ttya")) |
675 | strcpy(name, "ttyS0"); | 675 | strcpy(buf, "ttyS0"); |
676 | if (!strcmp(str, "ttyb")) | 676 | if (!strcmp(str, "ttyb")) |
677 | strcpy(name, "ttyS1"); | 677 | strcpy(buf, "ttyS1"); |
678 | #endif | 678 | #endif |
679 | for (s = name; *s; s++) | 679 | for (s = buf; *s; s++) |
680 | if ((*s >= '0' && *s <= '9') || *s == ',') | 680 | if ((*s >= '0' && *s <= '9') || *s == ',') |
681 | break; | 681 | break; |
682 | idx = simple_strtoul(s, NULL, 10); | 682 | idx = simple_strtoul(s, NULL, 10); |
683 | *s = 0; | 683 | *s = 0; |
684 | 684 | ||
685 | add_preferred_console(name, idx, options); | 685 | add_preferred_console(buf, idx, options); |
686 | return 1; | 686 | return 1; |
687 | } | 687 | } |
688 | __setup("console=", console_setup); | 688 | __setup("console=", console_setup); |
@@ -709,7 +709,7 @@ int __init add_preferred_console(char *name, int idx, char *options) | |||
709 | * See if this tty is not yet registered, and | 709 | * See if this tty is not yet registered, and |
710 | * if we have a slot free. | 710 | * if we have a slot free. |
711 | */ | 711 | */ |
712 | for(i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++) | 712 | for (i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++) |
713 | if (strcmp(console_cmdline[i].name, name) == 0 && | 713 | if (strcmp(console_cmdline[i].name, name) == 0 && |
714 | console_cmdline[i].index == idx) { | 714 | console_cmdline[i].index == idx) { |
715 | selected_console = i; | 715 | selected_console = i; |