diff mbox series

[1/1] efi/libstub/x86: simplify efi_is_native()

Message ID 20201003060356.4913-1-xypron.glpk@gmx.de
State Accepted
Commit bc13809f1c47245cd584f4ad31ad06a5c5f40e54
Headers show
Series [1/1] efi/libstub/x86: simplify efi_is_native() | expand

Commit Message

Heinrich Schuchardt Oct. 3, 2020, 6:03 a.m. UTC
CONFIG_EFI_MIXED depends on CONFIG_X86_64=y.
There is no need to check CONFIG_X86_64 again.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 arch/x86/include/asm/efi.h | 2 --
 1 file changed, 2 deletions(-)

--
2.28.0

Comments

Brian Gerst Oct. 3, 2020, 5:28 p.m. UTC | #1
On Sat, Oct 3, 2020 at 2:05 AM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>

> CONFIG_EFI_MIXED depends on CONFIG_X86_64=y.

> There is no need to check CONFIG_X86_64 again.

>

> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

> ---

>  arch/x86/include/asm/efi.h | 2 --

>  1 file changed, 2 deletions(-)

>

> diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h

> index b9c2667ac46c..ab28bf1c74cf 100644

> --- a/arch/x86/include/asm/efi.h

> +++ b/arch/x86/include/asm/efi.h

> @@ -223,8 +223,6 @@ static inline bool efi_is_64bit(void)

>

>  static inline bool efi_is_native(void)

>  {

> -       if (!IS_ENABLED(CONFIG_X86_64))

> -               return true;

>         return efi_is_64bit();

>  }


This would then return false for native 32-bit.

--
Brian Gerst
Arvind Sankar Oct. 3, 2020, 7:44 p.m. UTC | #2
On Sat, Oct 03, 2020 at 01:28:18PM -0400, Brian Gerst wrote:
> On Sat, Oct 3, 2020 at 2:05 AM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:

> >

> > CONFIG_EFI_MIXED depends on CONFIG_X86_64=y.

> > There is no need to check CONFIG_X86_64 again.

> >

> > Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

> > ---

> >  arch/x86/include/asm/efi.h | 2 --

> >  1 file changed, 2 deletions(-)

> >

> > diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h

> > index b9c2667ac46c..ab28bf1c74cf 100644

> > --- a/arch/x86/include/asm/efi.h

> > +++ b/arch/x86/include/asm/efi.h

> > @@ -223,8 +223,6 @@ static inline bool efi_is_64bit(void)

> >

> >  static inline bool efi_is_native(void)

> >  {

> > -       if (!IS_ENABLED(CONFIG_X86_64))

> > -               return true;

> >         return efi_is_64bit();

> >  }

> 

> This would then return false for native 32-bit.

> 

> --

> Brian Gerst


32-bit doesn't use this implementation: it's #define'd to true in
drivers/firmware/efi/libstub/efistub.h.

Thanks.
Ard Biesheuvel Oct. 4, 2020, 2:14 p.m. UTC | #3
On Sat, 3 Oct 2020 at 21:44, Arvind Sankar <nivedita@alum.mit.edu> wrote:
>

> On Sat, Oct 03, 2020 at 01:28:18PM -0400, Brian Gerst wrote:

> > On Sat, Oct 3, 2020 at 2:05 AM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:

> > >

> > > CONFIG_EFI_MIXED depends on CONFIG_X86_64=y.

> > > There is no need to check CONFIG_X86_64 again.

> > >

> > > Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

> > > ---

> > >  arch/x86/include/asm/efi.h | 2 --

> > >  1 file changed, 2 deletions(-)

> > >

> > > diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h

> > > index b9c2667ac46c..ab28bf1c74cf 100644

> > > --- a/arch/x86/include/asm/efi.h

> > > +++ b/arch/x86/include/asm/efi.h

> > > @@ -223,8 +223,6 @@ static inline bool efi_is_64bit(void)

> > >

> > >  static inline bool efi_is_native(void)

> > >  {

> > > -       if (!IS_ENABLED(CONFIG_X86_64))

> > > -               return true;

> > >         return efi_is_64bit();

> > >  }

> >

> > This would then return false for native 32-bit.

> >

> > --

> > Brian Gerst

>

> 32-bit doesn't use this implementation: it's #define'd to true in

> drivers/firmware/efi/libstub/efistub.h.

>


Yes, and the reason this [now redundant] test exists is because this
did not use to be the case before

de8c55208c386 efi/libstub: Fix mixed mode boot issue after macro refactor

So for this patch

Acked-by: Ard Biesheuvel <ardb@kernel.org>


I'll queue this up
Arvind Sankar Oct. 4, 2020, 2:40 p.m. UTC | #4
On Sun, Oct 04, 2020 at 04:14:11PM +0200, Ard Biesheuvel wrote:
> On Sat, 3 Oct 2020 at 21:44, Arvind Sankar <nivedita@alum.mit.edu> wrote:

> >

> > On Sat, Oct 03, 2020 at 01:28:18PM -0400, Brian Gerst wrote:

> > > On Sat, Oct 3, 2020 at 2:05 AM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:

> > > >

> > > > CONFIG_EFI_MIXED depends on CONFIG_X86_64=y.

> > > > There is no need to check CONFIG_X86_64 again.

> > > >

> > > > Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

> > > > ---

> > > >  arch/x86/include/asm/efi.h | 2 --

> > > >  1 file changed, 2 deletions(-)

> > > >

> > > > diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h

> > > > index b9c2667ac46c..ab28bf1c74cf 100644

> > > > --- a/arch/x86/include/asm/efi.h

> > > > +++ b/arch/x86/include/asm/efi.h

> > > > @@ -223,8 +223,6 @@ static inline bool efi_is_64bit(void)

> > > >

> > > >  static inline bool efi_is_native(void)

> > > >  {

> > > > -       if (!IS_ENABLED(CONFIG_X86_64))

> > > > -               return true;

> > > >         return efi_is_64bit();

> > > >  }

> > >

> > > This would then return false for native 32-bit.

> > >

> > > --

> > > Brian Gerst

> >

> > 32-bit doesn't use this implementation: it's #define'd to true in

> > drivers/firmware/efi/libstub/efistub.h.

> >

> 

> Yes, and the reason this [now redundant] test exists is because this

> did not use to be the case before

> 

> de8c55208c386 efi/libstub: Fix mixed mode boot issue after macro refactor


Heh, my fault for not cleaning it up then :)

> 

> So for this patch

> 

> Acked-by: Ard Biesheuvel <ardb@kernel.org>

> 

> I'll queue this up
diff mbox series

Patch

diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index b9c2667ac46c..ab28bf1c74cf 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -223,8 +223,6 @@  static inline bool efi_is_64bit(void)

 static inline bool efi_is_native(void)
 {
-	if (!IS_ENABLED(CONFIG_X86_64))
-		return true;
 	return efi_is_64bit();
 }