[PATCH] xen/riscv: Fix early_puts() newline handling

Andrew Cooper posted 1 patch 1 year, 1 month ago
Test gitlab-ci failed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20230315190325.668853-1-andrew.cooper3@citrix.com
xen/arch/riscv/early_printk.c | 2 --
1 file changed, 2 deletions(-)
[PATCH] xen/riscv: Fix early_puts() newline handling
Posted by Andrew Cooper 1 year, 1 month ago
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.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Bob Eshleman <bobbyeshleman@gmail.com>
CC: Alistair Francis <alistair.francis@wdc.com>
CC: Connor Davis <connojdavis@gmail.com>
---
 xen/arch/riscv/early_printk.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/xen/arch/riscv/early_printk.c b/xen/arch/riscv/early_printk.c
index b66a11f1bc1a..97a94885773b 100644
--- a/xen/arch/riscv/early_printk.c
+++ b/xen/arch/riscv/early_printk.c
@@ -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
Re: [PATCH] xen/riscv: Fix early_puts() newline handling
Posted by Alistair Francis 1 year, 1 month ago
On Thu, Mar 16, 2023 at 5:03 AM Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>
> 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.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
> CC: Bob Eshleman <bobbyeshleman@gmail.com>
> CC: Alistair Francis <alistair.francis@wdc.com>
> CC: Connor Davis <connojdavis@gmail.com>
> ---
>  xen/arch/riscv/early_printk.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/xen/arch/riscv/early_printk.c b/xen/arch/riscv/early_printk.c
> index b66a11f1bc1a..97a94885773b 100644
> --- a/xen/arch/riscv/early_printk.c
> +++ b/xen/arch/riscv/early_printk.c
> @@ -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
>
>