Skip to contentSkip to conversation

sh: remove unneeded $(foreach )

PATCH Applied Masahiro Yamada 2 participants 3 messages Nov 20, 2023 – Jan 19, 2024 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: remove unneeded $(foreach )

There is no need to use $(foreach ...) for iterating over just one parameter.

---

 arch/sh/kernel/vsyscall/Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/sh/kernel/vsyscall/Makefile +2 -3
index 6e8664448048..118744d349e2 100644
@@ -1,11 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-y += vsyscall.o vsyscall-syscall.o vsyscall-syms.o
 
-$(obj)/vsyscall-syscall.o: \
-	$(foreach F,trapa,$(obj)/vsyscall-$F.so)
+$(obj)/vsyscall-syscall.o: $(obj)/vsyscall-trapa.so
 
 # Teach kbuild about targets
-targets += $(foreach F,trapa,vsyscall-$F.o vsyscall-$F.so)
+targets += vsyscall-trapa.o vsyscall-traps.so
 targets += vsyscall-note.o vsyscall.lds vsyscall-dummy.o
 
 # The DSO images are built using a special linker script
Signature · 1 line
2.40.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Masahiro Yamada

There is no need to use $(foreach ...) for iterating over just one parameter.

---

 arch/sh/kernel/vsyscall/Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/sh/kernel/vsyscall/Makefile +0 -0
index 6e8664448048..118744d349e2 100644
@@ -1,11 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-y += vsyscall.o vsyscall-syscall.o vsyscall-syms.o
 

arch/sh/kernel/vsyscall/Makefile line 10

Quoted 10 lines
arch/sh/kernel/vsyscall/Makefile +2 -3
-$(obj)/vsyscall-syscall.o: \
-	$(foreach F,trapa,$(obj)/vsyscall-$F.so)
+$(obj)/vsyscall-syscall.o: $(obj)/vsyscall-trapa.so
 
 # Teach kbuild about targets
-targets += $(foreach F,trapa,vsyscall-$F.o vsyscall-$F.so)
+targets += vsyscall-trapa.o vsyscall-traps.so
 targets += vsyscall-note.o vsyscall.lds vsyscall-dummy.o
 
 # The DSO images are built using a special linker script
Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
maintainer Applied
#2 lore raw
In reply to Masahiro Yamada
Quoted 17 lines · Masahiro Yamada

There is no need to use $(foreach ...) for iterating over just one parameter.

---

 arch/sh/kernel/vsyscall/Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/sh/kernel/vsyscall/Makefile +0 -0
index 6e8664448048..118744d349e2 100644
@@ -1,11 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-y += vsyscall.o vsyscall-syscall.o vsyscall-syms.o
 

arch/sh/kernel/vsyscall/Makefile line 10

Quoted 10 lines
arch/sh/kernel/vsyscall/Makefile +2 -3
-$(obj)/vsyscall-syscall.o: \
-	$(foreach F,trapa,$(obj)/vsyscall-$F.so)
+$(obj)/vsyscall-syscall.o: $(obj)/vsyscall-trapa.so
 
 # Teach kbuild about targets
-targets += $(foreach F,trapa,vsyscall-$F.o vsyscall-$F.so)
+targets += vsyscall-trapa.o vsyscall-traps.so
 targets += vsyscall-note.o vsyscall.lds vsyscall-dummy.o
 
 # The DSO images are built using a special linker script

Applied to my sh-linux tree.

Thanks,
Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913