Skip to contentSkip to conversation

xen/riscv: Fix early_puts() newline handling

PATCH In review Andrew Cooper 2 participants 2 messages Mar 15, 2023 – Mar 16, 2023 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/riscv: Fix early_puts() newline handling

OpenSBI already expands \n to \r\n. Don't repeat the expansion, as it doubles the size of the resulting log with every other line being blank.

---
CC: Bob Eshleman <[email protected]>
CC: Alistair Francis <[email protected]>
CC: Connor Davis <[email protected]>

---
 xen/arch/riscv/early_printk.c | 2 --
 1 file changed, 2 deletions(-)
xen/arch/riscv/early_printk.c +0 -2
index b66a11f1bc1a..97a94885773b 100644
@@ -16,8 +16,6 @@ void early_puts(const char *s, size_t nr)
 {
     while ( nr-- > 0 )
     {
-        if ( *s == '\n' )
-            sbi_console_putchar('\r');
         sbi_console_putchar(*s);
         s++;
     }
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Andrew Cooper

OpenSBI already expands \n to \r\n. Don't repeat the expansion, as it doubles the size of the resulting log with every other line being blank.

Alistair

Quoted 25 lines

---
CC: Bob Eshleman <[email protected]>
CC: Alistair Francis <[email protected]>
CC: Connor Davis <[email protected]>

---
 xen/arch/riscv/early_printk.c | 2 --
 1 file changed, 2 deletions(-)
xen/arch/riscv/early_printk.c +0 -3
index b66a11f1bc1a..97a94885773b 100644
@@ -16,8 +16,6 @@ void early_puts(const char *s, size_t nr)
 {
     while ( nr-- > 0 )
     {
-        if ( *s == '\n' )
-            sbi_console_putchar('\r');
         sbi_console_putchar(*s);
         s++;
     }
--

2.30.2