]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
kbuild: use assignment instead of define ... endef for filechk_* rules
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 3 Jan 2019 01:16:54 +0000 (10:16 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sun, 6 Jan 2019 01:22:35 +0000 (10:22 +0900)
You do not have to use define ... endef for filechk_* rules.

For simple cases, the use of assignment looks cleaner, IMHO.

I updated the usage for scripts/Kbuild.include in case somebody
misunderstands the 'define ... endif' is the requirement.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Kbuild
Makefile
arch/s390/kernel/syscalls/Makefile
arch/s390/tools/Makefile
scripts/Kbuild.include
scripts/kconfig/Makefile

diff --git a/Kbuild b/Kbuild
index 06b801e12fb45bbee2256e5c7717c3750695de27..65db5bef2e3617eb080569c1061e72a8750a7394 100644 (file)
--- a/Kbuild
+++ b/Kbuild
@@ -26,9 +26,7 @@ timeconst-file := include/generated/timeconst.h
 
 targets += $(timeconst-file)
 
-define filechk_gentimeconst
-       echo $(CONFIG_HZ) | bc -q $<
-endef
+filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $<
 
 $(timeconst-file): kernel/time/timeconst.bc FORCE
        $(call filechk,gentimeconst)
index 437d6033598c2eedde0ed656dc78556daf3b678b..adf1bd212cf2a44a7fbb4a813493840180230ae6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1041,9 +1041,8 @@ PHONY += $(vmlinux-dirs)
 $(vmlinux-dirs): prepare
        $(Q)$(MAKE) $(build)=$@ need-builtin=1
 
-define filechk_kernel.release
+filechk_kernel.release = \
        echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
-endef
 
 # Store (new) KERNELRELEASE string in include/config/kernel.release
 include/config/kernel.release: $(srctree)/Makefile FORCE
index 4d929edc80a6296eecdd9911457d1fb691de6d6b..b98f25029b8e60adb08aae0ee8d51bee52c6f5d6 100644 (file)
@@ -24,17 +24,11 @@ uapi:       $(uapi-hdrs-y)
 _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \
          $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
 
-define filechk_syshdr
-       $(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $<
-endef
+filechk_syshdr = $(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $<
 
-define filechk_sysnr
-       $(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $<
-endef
+filechk_sysnr = $(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $<
 
-define filechk_syscalls
-       $(CONFIG_SHELL) '$(systbl)' -S < $<
-endef
+filechk_syscalls = $(CONFIG_SHELL) '$(systbl)' -S < $<
 
 syshdr_abi_unistd_32 := common,32
 $(uapi)/unistd_32.h: $(syscall) FORCE
index cf4846a7ee8d90aa970d9b3f41570724014cedb1..2342b84b338636bd671784e75f19ecca7dcfddfd 100644 (file)
@@ -20,13 +20,10 @@ HOSTCFLAGS_gen_opcode_table.o += -Wall $(LINUXINCLUDE)
 # Ensure output directory exists
 _dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
 
-define filechk_facility-defs.h
-       $(obj)/gen_facilities
-endef
+filechk_facility-defs.h = $(obj)/gen_facilities
 
-define filechk_dis-defs.h
+filechk_dis-defs.h = \
        $(obj)/gen_opcode_table < $(srctree)/arch/$(ARCH)/tools/opcodes.txt
-endef
 
 $(kapi)/facility-defs.h: $(obj)/gen_facilities FORCE
        $(call filechk,facility-defs.h)
index 74a3fe7ddc01822edf000f2b7cf2c48d112c667e..525bff667a528404ea887b57b4723096780d59bc 100644 (file)
@@ -41,11 +41,11 @@ kecho := $($(quiet)kecho)
 ###
 # filechk is used to check if the content of a generated file is updated.
 # Sample usage:
-# define filechk_sample
-#      echo $KERNELRELEASE
-# endef
-# version.h : Makefile
+#
+# filechk_sample = echo $(KERNELRELEASE)
+# version.h: FORCE
 #      $(call filechk,sample)
+#
 # The rule defined shall write to stdout the content of the new file.
 # The existing file will be compared with the new one.
 # - If no file exist it is created
index ec204fa54c9a6aeee96437e9b59f0198ca29ed28..679e62e5a15cde2d9bc87754c93cd8a0964a6a75 100644 (file)
@@ -201,9 +201,7 @@ HOSTCFLAGS_gconf.o  = $(shell . $(obj)/.gconf-cfg && echo $$cflags)
 $(obj)/gconf.o: $(obj)/.gconf-cfg
 
 # check if necessary packages are available, and configure build flags
-define filechk_conf_cfg
-       $(CONFIG_SHELL) $<
-endef
+filechk_conf_cfg = $(CONFIG_SHELL) $<
 
 $(obj)/.%conf-cfg: $(src)/%conf-cfg.sh FORCE
        $(call filechk,conf_cfg)