[PATCH v3] lib: sbi: Fix printf handling of long long

Anup Patel anup at brainfault.org
Sat Jul 30 03:27:34 PDT 2022


On Wed, Jul 27, 2022 at 10:14 PM Andrew Jones <ajones at ventanamicro.com> wrote:
>
> On Thu, Jul 28, 2022 at 12:30:05AM +0800, dramforever wrote:
> > Read long long arguments directly using va_arg. Remove original hack for
> > RV32 that read a long long arg as two long args.
> >
> > This un-breaks the case on RV64 where e.g. the long long is followed by
> > an odd number of ints:
> >
> >     sbi_printf("%d %lld", (int) 1, (long long) 2LL);
> >
> > Also remove the acnt variable, which is now unused.
> >
> > Signed-off-by: dramforever <dramforever at live.com>
> > ---
> >
> > Changes since v2:
> >
> > - Remove the acnt variable
> >
> > Changes since v1:
> >
> > - Removed hack that reads a long long as two longs
> > - Better commit message
> >
> >  lib/sbi/sbi_console.c | 30 ++----------------------------
> >  1 file changed, 2 insertions(+), 28 deletions(-)
> >
>
> Reviewed-by: Andrew Jones <ajones at ventanamicro.com>

Looks good to me.

Reviewed-by: Anup Patel <anup at brainfault.org>

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi



More information about the opensbi mailing list