From 7cbbbb8bc2974264bbbf326d9a4552fc8878d375 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sun, 17 Mar 2019 11:01:08 +0900 Subject: kbuild: warn redundant generic-y The generic-y is redundant under the following condition: - arch has its own implementation - the same header is added to generated-y - the same header is added to mandatory-y If a redundant generic-y is found, the warning like follows is displayed: scripts/Makefile.asm-generic:20: redundant generic-y found in arch/arm/include/asm/Kbuild: timex.h I fixed up arch Kbuild files found by this. Suggested-by: Sam Ravnborg Signed-off-by: Masahiro Yamada --- scripts/Makefile.asm-generic | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts/Makefile.asm-generic') diff --git a/scripts/Makefile.asm-generic b/scripts/Makefile.asm-generic index a62d2823f6cf..c7d2b7acad26 100644 --- a/scripts/Makefile.asm-generic +++ b/scripts/Makefile.asm-generic @@ -14,6 +14,12 @@ src := $(subst /generated,,$(obj)) include scripts/Kbuild.include +redundant := $(filter $(mandatory-y) $(generated-y), $(generic-y)) +redundant += $(foreach f, $(generic-y), $(if $(wildcard $(srctree)/$(src)/$(f)),$(f))) +redundant := $(sort $(redundant)) +$(if $(redundant),\ + $(warning redundant generic-y found in $(src)/Kbuild: $(redundant))) + # If arch does not implement mandatory headers, fallback to asm-generic ones. mandatory-y := $(filter-out $(generated-y), $(mandatory-y)) generic-y += $(foreach f, $(mandatory-y), $(if $(wildcard $(srctree)/$(src)/$(f)),,$(f))) -- cgit v1.2.3-59-g8ed1b