kbuild: refactor modname-multi by using suffix-search
authorMasahiro Yamada <masahiroy@kernel.org>
Sun, 2 May 2021 18:09:57 +0000 (03:09 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 5 May 2021 17:14:38 +0000 (02:14 +0900)
Improve the readability slightly.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/Makefile.lib

index deac607..1095055 100644 (file)
@@ -109,7 +109,7 @@ 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-obj-ym),\
-               $(if $(filter $*.o, $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$(m:.o=))))
+               $(if $(filter $*.o, $(call suffix-search, $m, .o, -objs -y -m)),$(m:.o=))))
 
 __modname = $(if $(modname-multi),$(modname-multi),$(basetarget))