diff options
-rw-r--r-- | arch/powerpc/kernel/prom_init.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 941ff4dbc567..7839bd7bfd15 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
@@ -335,6 +335,7 @@ static void __init prom_printf(const char *format, ...) | |||
335 | const char *p, *q, *s; | 335 | const char *p, *q, *s; |
336 | va_list args; | 336 | va_list args; |
337 | unsigned long v; | 337 | unsigned long v; |
338 | long vs; | ||
338 | struct prom_t *_prom = &RELOC(prom); | 339 | struct prom_t *_prom = &RELOC(prom); |
339 | 340 | ||
340 | va_start(args, format); | 341 | va_start(args, format); |
@@ -368,12 +369,35 @@ static void __init prom_printf(const char *format, ...) | |||
368 | v = va_arg(args, unsigned long); | 369 | v = va_arg(args, unsigned long); |
369 | prom_print_hex(v); | 370 | prom_print_hex(v); |
370 | break; | 371 | break; |
372 | case 'd': | ||
373 | ++q; | ||
374 | vs = va_arg(args, int); | ||
375 | if (vs < 0) { | ||
376 | prom_print(RELOC("-")); | ||
377 | vs = -vs; | ||
378 | } | ||
379 | prom_print_dec(vs); | ||
380 | break; | ||
371 | case 'l': | 381 | case 'l': |
372 | ++q; | 382 | ++q; |
373 | if (*q == 'u') { /* '%lu' */ | 383 | if (*q == 0) |
384 | break; | ||
385 | else if (*q == 'x') { | ||
386 | ++q; | ||
387 | v = va_arg(args, unsigned long); | ||
388 | prom_print_hex(v); | ||
389 | } else if (*q == 'u') { /* '%lu' */ | ||
374 | ++q; | 390 | ++q; |
375 | v = va_arg(args, unsigned long); | 391 | v = va_arg(args, unsigned long); |
376 | prom_print_dec(v); | 392 | prom_print_dec(v); |
393 | } else if (*q == 'd') { /* %ld */ | ||
394 | ++q; | ||
395 | vs = va_arg(args, long); | ||
396 | if (vs < 0) { | ||
397 | prom_print(RELOC("-")); | ||
398 | vs = -vs; | ||
399 | } | ||
400 | prom_print_dec(vs); | ||
377 | } | 401 | } |
378 | break; | 402 | break; |
379 | } | 403 | } |