Skip to content

Commit 4199aa5

Browse files
author
Fox Snowpatch
committed
1 parent a2f7734 commit 4199aa5

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

arch/powerpc/boot/main.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,16 @@ static inline void prep_esm_blob(struct addr_range vmlinux, void *chosen) { }
193193
static char cmdline[BOOT_COMMAND_LINE_SIZE]
194194
__attribute__((__section__("__builtin_cmdline")));
195195

196+
static void print_cmdline(const char *prefix, const char *suffix)
197+
{
198+
size_t len = strnlen(cmdline, BOOT_COMMAND_LINE_SIZE - 1);
199+
200+
printf("%s", prefix);
201+
if (console_ops.write && len)
202+
console_ops.write(cmdline, len);
203+
printf("%s", suffix);
204+
}
205+
196206
static void prep_cmdline(void *chosen)
197207
{
198208
unsigned int getline_timeout = 5000;
@@ -207,7 +217,7 @@ static void prep_cmdline(void *chosen)
207217
if (cmdline[0] == '\0')
208218
getprop(chosen, "bootargs", cmdline, BOOT_COMMAND_LINE_SIZE-1);
209219

210-
printf("\n\rLinux/PowerPC load: %s", cmdline);
220+
print_cmdline("\n\rLinux/PowerPC load: ", "");
211221

212222
/* If possible, edit the command line */
213223
if (console_ops.edit_cmdline && getline_timeout)

arch/powerpc/boot/ps3.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,24 @@ BSS_STACK(4096);
3131
static char cmdline[BOOT_COMMAND_LINE_SIZE]
3232
__attribute__((__section__("__builtin_cmdline")));
3333

34+
static void print_cmdline(const char *prefix, const char *suffix)
35+
{
36+
size_t len = strnlen(cmdline, BOOT_COMMAND_LINE_SIZE - 1);
37+
38+
printf("%s", prefix);
39+
if (console_ops.write && len)
40+
console_ops.write(cmdline, len);
41+
printf("%s", suffix);
42+
}
43+
3444
static void prep_cmdline(void *chosen)
3545
{
3646
if (cmdline[0] == '\0')
3747
getprop(chosen, "bootargs", cmdline, BOOT_COMMAND_LINE_SIZE-1);
3848
else
3949
setprop_str(chosen, "bootargs", cmdline);
4050

41-
printf("cmdline: '%s'\n", cmdline);
51+
print_cmdline("cmdline: '", "'\n");
4252
}
4353

4454
static void ps3_console_write(const char *buf, int len)

0 commit comments

Comments
 (0)