mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
![Masahiro Yamada](/assets/img/avatar_default.png)
Change a header to mandatory-y if both of the following are met: [1] At least one architecture (except um) specifies it as generic-y in arch/*/include/asm/Kbuild [2] Every architecture (except um) either has its own implementation (arch/*/include/asm/*.h) or specifies it as generic-y in arch/*/include/asm/Kbuild This commit was generated by the following shell script. ----------------------------------->8----------------------------------- arches=$(cd arch; ls -1 | sed -e '/Kconfig/d' -e '/um/d') tmpfile=$(mktemp) grep "^mandatory-y +=" include/asm-generic/Kbuild > $tmpfile find arch -path 'arch/*/include/asm/Kbuild' | xargs sed -n 's/^generic-y += \(.*\)/\1/p' | sort -u | while read header do mandatory=yes for arch in $arches do if ! grep -q "generic-y += $header" arch/$arch/include/asm/Kbuild && ! [ -f arch/$arch/include/asm/$header ]; then mandatory=no break fi done if [ "$mandatory" = yes ]; then echo "mandatory-y += $header" >> $tmpfile for arch in $arches do sed -i "/generic-y += $header/d" arch/$arch/include/asm/Kbuild done fi done sed -i '/^mandatory-y +=/d' include/asm-generic/Kbuild LANG=C sort $tmpfile >> include/asm-generic/Kbuild ----------------------------------->8----------------------------------- One obvious benefit is the diff stat: 25 files changed, 52 insertions(+), 557 deletions(-) It is tedious to list generic-y for each arch that needs it. So, mandatory-y works like a fallback default (by just wrapping asm-generic one) when arch does not have a specific header implementation. See the following commits:def3f7cefe
a1b39bae16
It is tedious to convert headers one by one, so I processed by a shell script. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Arnd Bergmann <arnd@arndb.de> Link: http://lkml.kernel.org/r/20200210175452.5030-1-masahiroy@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
61 lines
1.5 KiB
Makefile
61 lines
1.5 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# asm headers that all architectures except um should have
|
|
# (This file is not included when SRCARCH=um since UML borrows several
|
|
# asm headers from the host architecutre.)
|
|
|
|
mandatory-y += atomic.h
|
|
mandatory-y += barrier.h
|
|
mandatory-y += bitops.h
|
|
mandatory-y += bug.h
|
|
mandatory-y += bugs.h
|
|
mandatory-y += cacheflush.h
|
|
mandatory-y += checksum.h
|
|
mandatory-y += compat.h
|
|
mandatory-y += current.h
|
|
mandatory-y += delay.h
|
|
mandatory-y += device.h
|
|
mandatory-y += div64.h
|
|
mandatory-y += dma-contiguous.h
|
|
mandatory-y += dma-mapping.h
|
|
mandatory-y += dma.h
|
|
mandatory-y += emergency-restart.h
|
|
mandatory-y += exec.h
|
|
mandatory-y += fb.h
|
|
mandatory-y += ftrace.h
|
|
mandatory-y += futex.h
|
|
mandatory-y += hardirq.h
|
|
mandatory-y += hw_irq.h
|
|
mandatory-y += io.h
|
|
mandatory-y += irq.h
|
|
mandatory-y += irq_regs.h
|
|
mandatory-y += irq_work.h
|
|
mandatory-y += kdebug.h
|
|
mandatory-y += kmap_types.h
|
|
mandatory-y += kprobes.h
|
|
mandatory-y += linkage.h
|
|
mandatory-y += local.h
|
|
mandatory-y += mm-arch-hooks.h
|
|
mandatory-y += mmiowb.h
|
|
mandatory-y += mmu.h
|
|
mandatory-y += mmu_context.h
|
|
mandatory-y += module.h
|
|
mandatory-y += msi.h
|
|
mandatory-y += pci.h
|
|
mandatory-y += percpu.h
|
|
mandatory-y += pgalloc.h
|
|
mandatory-y += preempt.h
|
|
mandatory-y += sections.h
|
|
mandatory-y += serial.h
|
|
mandatory-y += shmparam.h
|
|
mandatory-y += simd.h
|
|
mandatory-y += switch_to.h
|
|
mandatory-y += timex.h
|
|
mandatory-y += tlbflush.h
|
|
mandatory-y += topology.h
|
|
mandatory-y += trace_clock.h
|
|
mandatory-y += uaccess.h
|
|
mandatory-y += unaligned.h
|
|
mandatory-y += vga.h
|
|
mandatory-y += word-at-a-time.h
|
|
mandatory-y += xor.h
|