diff options
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/kernel/early.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index c9ffe0025197..52098d6dfaa7 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c | |||
@@ -434,18 +434,22 @@ static void __init append_to_cmdline(size_t (*ipl_data)(char *, size_t)) | |||
434 | } | 434 | } |
435 | } | 435 | } |
436 | 436 | ||
437 | static void __init setup_boot_command_line(void) | 437 | static inline int has_ebcdic_char(const char *str) |
438 | { | 438 | { |
439 | int i; | 439 | int i; |
440 | 440 | ||
441 | /* convert arch command line to ascii */ | 441 | for (i = 0; str[i]; i++) |
442 | for (i = 0; i < ARCH_COMMAND_LINE_SIZE; i++) | 442 | if (str[i] & 0x80) |
443 | if (COMMAND_LINE[i] & 0x80) | 443 | return 1; |
444 | break; | 444 | return 0; |
445 | if (i < ARCH_COMMAND_LINE_SIZE) | 445 | } |
446 | EBCASC(COMMAND_LINE, ARCH_COMMAND_LINE_SIZE); | ||
447 | COMMAND_LINE[ARCH_COMMAND_LINE_SIZE-1] = 0; | ||
448 | 446 | ||
447 | static void __init setup_boot_command_line(void) | ||
448 | { | ||
449 | COMMAND_LINE[ARCH_COMMAND_LINE_SIZE - 1] = 0; | ||
450 | /* convert arch command line to ascii if necessary */ | ||
451 | if (has_ebcdic_char(COMMAND_LINE)) | ||
452 | EBCASC(COMMAND_LINE, ARCH_COMMAND_LINE_SIZE); | ||
449 | /* copy arch command line */ | 453 | /* copy arch command line */ |
450 | strlcpy(boot_command_line, strstrip(COMMAND_LINE), | 454 | strlcpy(boot_command_line, strstrip(COMMAND_LINE), |
451 | ARCH_COMMAND_LINE_SIZE); | 455 | ARCH_COMMAND_LINE_SIZE); |