[PATCH 2/3] include: sbi: No need to pack struct sbi_scratch

Anup Patel Anup.Patel at wdc.com
Fri Jan 15 00:16:15 EST 2021



> -----Original Message-----
> From: Alistair Francis <Alistair.Francis at wdc.com>
> Sent: 14 January 2021 01:14
> To: Atish Patra <Atish.Patra at wdc.com>; Anup Patel
> <Anup.Patel at wdc.com>
> Cc: anup at brainfault.org; opensbi at lists.infradead.org; taniwha at gmail.com
> Subject: Re: [PATCH 2/3] include: sbi: No need to pack struct sbi_scratch
> 
> On Wed, 2021-01-13 at 15:36 +0530, Anup Patel wrote:
> > All members in struct sbi_scrach are of machine word size so no need
> > to pack this structure. This also allows GCC to generate more
> > optimized instruction sequence when accessing members of struct
> > sbi_scratch.
> >
> > Reported-by: Paul Campbell <taniwha at gmail.com>
> > Signed-off-by: Anup Patel <anup.patel at wdc.com>
> 
> Reviewed-by: Alistair Francis <alistair.francis at wdc.com>
> 
> Alistair
> 
> > ---
> >  include/sbi/sbi_scratch.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/sbi/sbi_scratch.h b/include/sbi/sbi_scratch.h
> > index e7079f5..e35122b 100644
> > --- a/include/sbi/sbi_scratch.h
> > +++ b/include/sbi/sbi_scratch.h
> > @@ -71,7 +71,7 @@ struct sbi_scratch {
> >         unsigned long tmp0;
> >         /** Options for OpenSBI library */
> >         unsigned long options;
> > -} __packed;
> > +};
> >
> >  /** Possible options for OpenSBI library */
> >  enum sbi_scratch_options {

Applied this patch to the riscv/opensbi repo

Regards,
Anup


More information about the opensbi mailing list