[PATCH 3/7] powerpc: replace cc-option-yn uses with cc-option

Masahiro Yamada masahiroy at kernel.org
Fri Aug 20 06:04:13 AEST 2021


On Tue, Aug 17, 2021 at 11:31 AM Michael Ellerman <mpe at ellerman.id.au> wrote:
>
> Nick Desaulniers <ndesaulniers at google.com> writes:
> > cc-option-yn can be replaced with cc-option. ie.
> > Checking for support:
> > ifeq ($(call cc-option-yn,$(FLAG)),y)
> > becomes:
> > ifneq ($(call cc-option,$(FLAG)),)
> >
> > Checking for lack of support:
> > ifeq ($(call cc-option-yn,$(FLAG)),n)
> > becomes:
> > ifeq ($(call cc-option,$(FLAG)),)
> >
> > This allows us to pursue removing cc-option-yn.
> >
> > Cc: Michael Ellerman <mpe at ellerman.id.au>
> > Cc: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> > Cc: Paul Mackerras <paulus at samba.org>
> > Cc: linuxppc-dev at lists.ozlabs.org
> > Signed-off-by: Nick Desaulniers <ndesaulniers at google.com>
> > ---
> >  arch/powerpc/Makefile      | 12 ++++++------
> >  arch/powerpc/boot/Makefile |  5 +----
> >  2 files changed, 7 insertions(+), 10 deletions(-)
> >
> > diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> > index 9aaf1abbc641..85e224536cf7 100644
> > --- a/arch/powerpc/Makefile
> > +++ b/arch/powerpc/Makefile
> > @@ -12,12 +12,12 @@
> >  # Rewritten by Cort Dougan and Paul Mackerras
> >  #
> >
> > -HAS_BIARCH   := $(call cc-option-yn, -m32)
> > +HAS_BIARCH   := $(call cc-option,-m32)
> >
> >  # Set default 32 bits cross compilers for vdso and boot wrapper
> >  CROSS32_COMPILE ?=
> >
> > -ifeq ($(HAS_BIARCH),y)
> > +ifeq ($(HAS_BIARCH),-m32)
>
> I don't love that we have to repeat "-m32" in each check.
>
> I'm pretty sure you can use ifdef here, because HAS_BIARCH is a simple
> variable (assigned with ":=").
>
> ie, this can be:
>
>   ifdef HAS_BIARCH
>
>
> And that avoids having to spell out "-m32" everywhere.
>
> cheers


Yes.

Comments from Nathan and Michael
both sound good.

-- 
Best Regards
Masahiro Yamada


More information about the Linuxppc-dev mailing list