diff mbox series

ARM: simplify the build rule of mach-types.h

Message ID 20210528035209.2157823-1-masahiroy@kernel.org (mailing list archive)
State New, archived
Headers show
Series ARM: simplify the build rule of mach-types.h | expand

Commit Message

Masahiro Yamada May 28, 2021, 3:52 a.m. UTC
The directory of mach-types.h is created a couple of lines above:

  _dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') \

The 'mkdir -p' command is redundant.

scripts/Kbuild.include defines real-prereqs as a shorthand for
$(filter-out $(PHONY),$^). Let's use it to simplify the code.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

KernelVersion: v5.13-rc1

 arch/arm/tools/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Linus Walleij May 28, 2021, 8:23 a.m. UTC | #1
On Fri, May 28, 2021 at 5:52 AM Masahiro Yamada <masahiroy@kernel.org> wrote:

> The directory of mach-types.h is created a couple of lines above:
>
>   _dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') \
>
> The 'mkdir -p' command is redundant.
>
> scripts/Kbuild.include defines real-prereqs as a shorthand for
> $(filter-out $(PHONY),$^). Let's use it to simplify the code.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Can you put this into Russell's patch tracker or shall I sign
it off and put it there?

Yours,
Linus Walleij
Masahiro Yamada May 28, 2021, 9:15 a.m. UTC | #2
On Fri, May 28, 2021 at 5:24 PM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Fri, May 28, 2021 at 5:52 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> > The directory of mach-types.h is created a couple of lines above:
> >
> >   _dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') \
> >
> > The 'mkdir -p' command is redundant.
> >
> > scripts/Kbuild.include defines real-prereqs as a shorthand for
> > $(filter-out $(PHONY),$^). Let's use it to simplify the code.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> Can you put this into Russell's patch tracker or shall I sign
> it off and put it there?


I sent this to patches@arm.linux.org.uk

It is already there.
https://www.arm.linux.org.uk/developer/patches/section.php?section=0
diff mbox series

Patch

diff --git a/arch/arm/tools/Makefile b/arch/arm/tools/Makefile
index 87de1f63f649..057639019059 100644
--- a/arch/arm/tools/Makefile
+++ b/arch/arm/tools/Makefile
@@ -33,8 +33,7 @@  _dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') \
           $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')
 
 quiet_cmd_gen_mach = GEN     $@
-      cmd_gen_mach = mkdir -p $(dir $@) && \
-		     $(AWK) -f $(filter-out $(PHONY),$^) > $@
+      cmd_gen_mach = $(AWK) -f $(real-prereqs) > $@
 
 $(kapi)/mach-types.h: $(src)/gen-mach-types $(src)/mach-types FORCE
 	$(call if_changed,gen_mach)