Skip to contentSkip to conversation

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

PATCH In review Masahiro Yamada 2 participants 3 messages May 28, 2021 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

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

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.

---

KernelVersion: v5.13-rc1

 arch/arm/tools/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm/tools/Makefile +1 -2
index 87de1f63f649..057639019059 100644
@@ -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)
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Masahiro Yamada

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.

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

Yours,
Linus Walleij

#2 lore raw
Quoted 12 lines · Linus Walleij
Quoted 9 lines · Masahiro Yamada

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.

Quoted 6 lines
Quoted 1 line

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

I sent this to [email protected]

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

Signature · 2 lines
Best Regards
Masahiro Yamada