Skip to content

Commit

Permalink
kbuild: warn redundant generic-y
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
masahir0y committed Mar 17, 2019
1 parent f84dde1 commit 7cbbbb8
Show file tree
Hide file tree
Showing 12 changed files with 6 additions and 13 deletions.
1 change: 0 additions & 1 deletion arch/arm/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ generic-y += segment.h
generic-y += serial.h
generic-y += simd.h
generic-y += sizes.h
generic-y += timex.h
generic-y += trace_clock.h

generated-y += mach-types.h
Expand Down
1 change: 0 additions & 1 deletion arch/h8300/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ generic-y += fb.h
generic-y += ftrace.h
generic-y += futex.h
generic-y += hardirq.h
generic-y += hash.h
generic-y += hw_irq.h
generic-y += irq_regs.h
generic-y += irq_work.h
Expand Down
1 change: 0 additions & 1 deletion arch/ia64/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_64.h
generic-y += kvm_para.h
generic-y += socket.h
2 changes: 0 additions & 2 deletions arch/openrisc/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ generic-y += fb.h
generic-y += ftrace.h
generic-y += hardirq.h
generic-y += hw_irq.h
generic-y += irq.h
generic-y += irq_regs.h
generic-y += irq_work.h
generic-y += kdebug.h
Expand All @@ -35,7 +34,6 @@ generic-y += qrwlock.h
generic-y += sections.h
generic-y += segment.h
generic-y += shmparam.h
generic-y += string.h
generic-y += switch_to.h
generic-y += topology.h
generic-y += trace_clock.h
Expand Down
2 changes: 0 additions & 2 deletions arch/parisc/include/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
generated-y += syscall_table_32.h
generated-y += syscall_table_64.h
generated-y += syscall_table_c32.h
generic-y += barrier.h
generic-y += current.h
generic-y += device.h
generic-y += div64.h
Expand All @@ -20,7 +19,6 @@ generic-y += percpu.h
generic-y += preempt.h
generic-y += seccomp.h
generic-y += segment.h
generic-y += topology.h
generic-y += trace_clock.h
generic-y += user.h
generic-y += vga.h
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ generated-y += syscall_table_spu.h
generic-y += div64.h
generic-y += export.h
generic-y += irq_regs.h
generic-y += irq_work.h
generic-y += local64.h
generic-y += mcs_spinlock.h
generic-y += preempt.h
Expand Down
1 change: 0 additions & 1 deletion arch/s390/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ generic-y += local.h
generic-y += local64.h
generic-y += mcs_spinlock.h
generic-y += mm-arch-hooks.h
generic-y += preempt.h
generic-y += rwsem.h
generic-y += trace_clock.h
generic-y += unaligned.h
Expand Down
1 change: 0 additions & 1 deletion arch/s390/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generated-y += unistd_64.h
generic-y += socket.h
1 change: 0 additions & 1 deletion arch/x86/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ include include/uapi/asm-generic/Kbuild.asm
generated-y += unistd_32.h
generated-y += unistd_64.h
generated-y += unistd_x32.h
generic-y += socket.h
1 change: 0 additions & 1 deletion arch/xtensa/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ generic-y += irq_work.h
generic-y += kdebug.h
generic-y += kmap_types.h
generic-y += kprobes.h
generic-y += linkage.h
generic-y += local.h
generic-y += local64.h
generic-y += mcs_spinlock.h
Expand Down
1 change: 0 additions & 1 deletion arch/xtensa/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generic-y += kvm_para.h
generic-y += socket.h
6 changes: 6 additions & 0 deletions scripts/Makefile.asm-generic
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 7cbbbb8

Please sign in to comment.