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.
Showing the changes to scripts (1 of 12 files). Show all
Unified · Split
| @@ -14,6 +14,12 @@ src := $(subst /generated,,$(obj)) · 13 unmodified lines | |||
| 14 | 14 | ||
| 15 | include scripts/Kbuild.include | 15 | include scripts/Kbuild.include |
| 16 | 16 | ||
| 17 | redundant := $(filter $(mandatory-y) $(generated-y), $(generic-y)) | ||
| 18 | redundant += $(foreach f, $(generic-y), $(if $(wildcard $(srctree)/$(src)/$(f)),$(f))) | ||
| 19 | redundant := $(sort $(redundant)) | ||
| 20 | $(if $(redundant),\ | ||
| 21 | $(warning redundant generic-y found in $(src)/Kbuild: $(redundant))) | ||
| 22 | |||
| 17 | # If arch does not implement mandatory headers, fallback to asm-generic ones. | 23 | # If arch does not implement mandatory headers, fallback to asm-generic ones. |
| 18 | mandatory-y := $(filter-out $(generated-y), $(mandatory-y)) | 24 | mandatory-y := $(filter-out $(generated-y), $(mandatory-y)) |
| 19 | generic-y += $(foreach f, $(mandatory-y), $(if $(wildcard $(srctree)/$(src)/$(f)),,$(f))) | 25 | generic-y += $(foreach f, $(mandatory-y), $(if $(wildcard $(srctree)/$(src)/$(f)),,$(f))) |