linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] kbuild: rename multi-used-* to multi-obj-*
@ 2021-03-06  6:11 Masahiro Yamada
  2021-03-06  6:11 ` [PATCH 2/2] kbuild: move $(strip ) to suffix-search definition Masahiro Yamada
  2021-03-09 15:33 ` [PATCH 1/2] kbuild: rename multi-used-* to multi-obj-* Masahiro Yamada
  0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2021-03-06  6:11 UTC (permalink / raw)
  To: linux-kbuild; +Cc: linux-kernel, Masahiro Yamada, Michal Marek

I think multi-obj-* is clearer, and more consisten with real-obj-*.

Rename as follows:

  multi-used-y  ->  multi-obj-y
  multi-used-m  ->  multi-obj-m
  multi-used    ->  multi-obj-ym

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

 scripts/Makefile.build |  6 +++---
 scripts/Makefile.lib   | 10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 1b6094a13034..56cf8eb475cf 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -444,11 +444,11 @@ quiet_cmd_link_multi-m = LD [M]  $@
       cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^)
 endif
 
-$(multi-used-m): FORCE
+$(multi-obj-m): FORCE
 	$(call if_changed,link_multi-m)
-$(call multi_depend, $(multi-used-m), .o, -objs -y -m)
+$(call multi_depend, $(multi-obj-m), .o, -objs -y -m)
 
-targets += $(multi-used-m)
+targets += $(multi-obj-m)
 targets := $(filter-out $(PHONY), $(targets))
 
 # Add intermediate targets:
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index eee59184de64..e60be0bddda2 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -48,9 +48,9 @@ endif
 suffix-search = $(foreach s,$(2),$($(1:.o=$s)))
 # If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object
 multi-search = $(sort $(foreach m,$(1), $(if $(strip $(call suffix-search,$(m),$(2) -)), $(m))))
-multi-used-y := $(call multi-search,$(obj-y),-objs -y)
-multi-used-m := $(call multi-search,$(obj-m),-objs -y -m)
-multi-used   := $(multi-used-y) $(multi-used-m)
+multi-obj-y := $(call multi-search,$(obj-y),-objs -y)
+multi-obj-m := $(call multi-search,$(obj-m),-objs -y -m)
+multi-obj-ym := $(multi-obj-y) $(multi-obj-m)
 
 # Replace multi-part objects by their individual parts,
 # including built-in.a from subdirectories
@@ -92,12 +92,12 @@ obj-m		:= $(addprefix $(obj)/,$(obj-m))
 lib-y		:= $(addprefix $(obj)/,$(lib-y))
 real-obj-y	:= $(addprefix $(obj)/,$(real-obj-y))
 real-obj-m	:= $(addprefix $(obj)/,$(real-obj-m))
-multi-used-m	:= $(addprefix $(obj)/,$(multi-used-m))
+multi-obj-m	:= $(addprefix $(obj)/, $(multi-obj-m))
 subdir-ym	:= $(addprefix $(obj)/,$(subdir-ym))
 
 # Finds the multi-part object the current object will be linked into.
 # If the object belongs to two or more multi-part objects, list them all.
-modname-multi = $(sort $(foreach m,$(multi-used),\
+modname-multi = $(sort $(foreach m,$(multi-obj-ym),\
 		$(if $(filter $*.o, $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$(m:.o=))))
 
 __modname = $(if $(modname-multi),$(modname-multi),$(basetarget))
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] kbuild: move $(strip ) to suffix-search definition
  2021-03-06  6:11 [PATCH 1/2] kbuild: rename multi-used-* to multi-obj-* Masahiro Yamada
@ 2021-03-06  6:11 ` Masahiro Yamada
  2021-03-09 15:33 ` [PATCH 1/2] kbuild: rename multi-used-* to multi-obj-* Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2021-03-06  6:11 UTC (permalink / raw)
  To: linux-kbuild; +Cc: linux-kernel, Masahiro Yamada, Michal Marek

Move $(strip ...) to the callee from the callers of suffix-search. It
shortens the code slightly. Adding a space after a comma will not be
a matter. I also dropped parentheses from single character variables.

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

 scripts/Makefile.lib | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index e60be0bddda2..4c0f952da84f 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -45,16 +45,16 @@ obj-y		:= $(filter-out %/, $(obj-y))
 endif
 
 # Expand $(foo-objs) $(foo-y) by calling $(call suffix-search,foo.o,-objs -y)
-suffix-search = $(foreach s,$(2),$($(1:.o=$s)))
+suffix-search = $(strip $(foreach s, $2, $($(1:.o=$s))))
 # If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object
-multi-search = $(sort $(foreach m,$(1), $(if $(strip $(call suffix-search,$(m),$(2) -)), $(m))))
+multi-search = $(sort $(foreach m, $1, $(if $(call suffix-search, $m, $2 -), $m)))
 multi-obj-y := $(call multi-search,$(obj-y),-objs -y)
 multi-obj-m := $(call multi-search,$(obj-m),-objs -y -m)
 multi-obj-ym := $(multi-obj-y) $(multi-obj-m)
 
 # Replace multi-part objects by their individual parts,
 # including built-in.a from subdirectories
-real-search = $(foreach m,$(1), $(if $(strip $(call suffix-search,$(m),$(2) -)),$(call suffix-search,$(m),$(2)),$(m)))
+real-search = $(foreach m, $1, $(if $(call suffix-search, $m, $2 -), $(call suffix-search, $m, $2), $m))
 real-obj-y := $(call real-search, $(obj-y),-objs -y)
 real-obj-m := $(call real-search, $(obj-m),-objs -y -m)
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] kbuild: rename multi-used-* to multi-obj-*
  2021-03-06  6:11 [PATCH 1/2] kbuild: rename multi-used-* to multi-obj-* Masahiro Yamada
  2021-03-06  6:11 ` [PATCH 2/2] kbuild: move $(strip ) to suffix-search definition Masahiro Yamada
@ 2021-03-09 15:33 ` Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2021-03-09 15:33 UTC (permalink / raw)
  To: Linux Kbuild mailing list; +Cc: Linux Kernel Mailing List, Michal Marek

On Sat, Mar 6, 2021 at 3:11 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> I think multi-obj-* is clearer, and more consisten with real-obj-*.
>
> Rename as follows:
>
>   multi-used-y  ->  multi-obj-y
>   multi-used-m  ->  multi-obj-m
>   multi-used    ->  multi-obj-ym
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Fixed the typo "consisten" to "consistent",
and applied to linux-kbuild.




> ---
>
>  scripts/Makefile.build |  6 +++---
>  scripts/Makefile.lib   | 10 +++++-----
>  2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 1b6094a13034..56cf8eb475cf 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -444,11 +444,11 @@ quiet_cmd_link_multi-m = LD [M]  $@
>        cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^)
>  endif
>
> -$(multi-used-m): FORCE
> +$(multi-obj-m): FORCE
>         $(call if_changed,link_multi-m)
> -$(call multi_depend, $(multi-used-m), .o, -objs -y -m)
> +$(call multi_depend, $(multi-obj-m), .o, -objs -y -m)
>
> -targets += $(multi-used-m)
> +targets += $(multi-obj-m)
>  targets := $(filter-out $(PHONY), $(targets))
>
>  # Add intermediate targets:
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index eee59184de64..e60be0bddda2 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -48,9 +48,9 @@ endif
>  suffix-search = $(foreach s,$(2),$($(1:.o=$s)))
>  # If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object
>  multi-search = $(sort $(foreach m,$(1), $(if $(strip $(call suffix-search,$(m),$(2) -)), $(m))))
> -multi-used-y := $(call multi-search,$(obj-y),-objs -y)
> -multi-used-m := $(call multi-search,$(obj-m),-objs -y -m)
> -multi-used   := $(multi-used-y) $(multi-used-m)
> +multi-obj-y := $(call multi-search,$(obj-y),-objs -y)
> +multi-obj-m := $(call multi-search,$(obj-m),-objs -y -m)
> +multi-obj-ym := $(multi-obj-y) $(multi-obj-m)
>
>  # Replace multi-part objects by their individual parts,
>  # including built-in.a from subdirectories
> @@ -92,12 +92,12 @@ obj-m               := $(addprefix $(obj)/,$(obj-m))
>  lib-y          := $(addprefix $(obj)/,$(lib-y))
>  real-obj-y     := $(addprefix $(obj)/,$(real-obj-y))
>  real-obj-m     := $(addprefix $(obj)/,$(real-obj-m))
> -multi-used-m   := $(addprefix $(obj)/,$(multi-used-m))
> +multi-obj-m    := $(addprefix $(obj)/, $(multi-obj-m))
>  subdir-ym      := $(addprefix $(obj)/,$(subdir-ym))
>
>  # Finds the multi-part object the current object will be linked into.
>  # If the object belongs to two or more multi-part objects, list them all.
> -modname-multi = $(sort $(foreach m,$(multi-used),\
> +modname-multi = $(sort $(foreach m,$(multi-obj-ym),\
>                 $(if $(filter $*.o, $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$(m:.o=))))
>
>  __modname = $(if $(modname-multi),$(modname-multi),$(basetarget))
> --
> 2.27.0
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-09 15:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-06  6:11 [PATCH 1/2] kbuild: rename multi-used-* to multi-obj-* Masahiro Yamada
2021-03-06  6:11 ` [PATCH 2/2] kbuild: move $(strip ) to suffix-search definition Masahiro Yamada
2021-03-09 15:33 ` [PATCH 1/2] kbuild: rename multi-used-* to multi-obj-* Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).