x86: audit and remove needless module.h includes
cover x86: audit and remove needless module.h includes
Originally module.h provided support for both what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends.
That changed when we forked out support for the latter into the export.h header; roughly five years ago[1].
We dealt with the immediate fallout of that change back then, but we did not go through and "downgrade" all the non-modular module.h users to export.h, once the merge of that change enabled us to do so.
This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. In the case of some of these which are modular, we can extend that to also include files that are building basic support functionality but not related to loading or registering the final module; such files also have no need whatsoever for module.h
The advantage in removing such instances is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.
Consider the following pseudo patch to introduce a no-op source that just includes module.h:
diff --git a/init/Makefile b/init/Makefile
--- a/init/Makefile
+++ b/init/Makefile
@@ -2,7 +2,7 @@
-obj-y := main.o version.o mounts.o
+obj-y := main.o version.o mounts.o foo.o
diff --git a/init/foo.c b/init/foo.c
new file mode 100644
--- /dev/null
+++ b/init/foo.c
@@ -0,0 +1 @@
+#include <linux/module.h>With that in place, we then can see the impact with this:
paul@builder:~/git/linux-head$ make O=../x86_64-build/ init/foo.i
make[1]: Entering directory '/home/paul/git/x86_64-build'
CPP init/foo.ipaul@builder:~/git/linux-head$ ls -lh ../x86_64-build/init/foo.i -rw-rw-r-- 1 paul paul 754K Jul 12 20:04 ../x86_64-build/init/foo.i
So, with every module.h include, we guarantee a minimum of 3/4 of a MB of text output from cpp as the baseline of header preamble to process.
Repeating the same experiment with <linux/init.h> and the result is less than 12kB; with <linux/export.h> it is only about 1/2kB; with both it still is less than 12kB.
In this series we manage to remove about 120 includes of module.h that just simply don't need to exist anymore in arch/x86.
Since module.h might be the implicit source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each instance for the requirement of either and replace as needed. Some additional implicit include issues were also fixed up as they appeared during build coverage.
The series was done on a per directory level for the larger dirs and then we tackle the remainder in the final commit. This seemed like a better solution than one giant commit, since it covers some distinct subsystems like kvm and xen for ease of review for those folks.
There is no urgency to get this in tree, it can easily wait three weeks. That said, the risk here is entirely on introducing build failures -- there is no changes to generated code, so if build coverage is exhaustive, the risk should be zero.
To that end, I have done allmodconfig, allyesconfig and allnoconfig for both 32 bit and 64 bit x86 with these changes on the linux-next from today, which presumably has an up to date copy of tip in it.
Paul.
[1] https://lwn.net/Articles/453517/
---
Paul Gortmaker (8):
x86: don't use module.h just for AUTHOR / LICENSE tags
x86: mm: audit and remove any unnecessary uses of module.h
x86: kernel: audit and remove any unnecessary uses of module.h
x86: lib: audit and remove any unnecessary uses of module.h
x86: platform: audit and remove any unnecessary uses of module.h
x86: xen: audit and remove any unnecessary uses of module.h
x86: kvm: audit and remove any unnecessary uses of module.h
x86: audit and remove any remaining unnecessary uses of module.h
arch/x86/crypto/glue_helper.c | 4 +--- arch/x86/events/amd/ibs.c | 3 ++- arch/x86/events/amd/iommu.c | 2 +- arch/x86/events/core.c | 3 ++- arch/x86/events/intel/uncore.c | 2 ++ arch/x86/events/intel/uncore.h | 1 - arch/x86/include/asm/livepatch.h | 1 - arch/x86/include/asm/topology.h | 1 + arch/x86/kernel/acpi/boot.c | 2 +- arch/x86/kernel/acpi/cstate.c | 2 +- arch/x86/kernel/amd_gart_64.c | 1 - arch/x86/kernel/amd_nb.c | 2 +- arch/x86/kernel/apic/apic.c | 2 +- arch/x86/kernel/apic/apic_flat_64.c | 2 +- arch/x86/kernel/apic/apic_noop.c | 1 - arch/x86/kernel/apic/hw_nmi.c | 2 +- arch/x86/kernel/apic/io_apic.c | 2 +- arch/x86/kernel/apic/ipi.c | 1 - arch/x86/kernel/apic/probe_32.c | 2 +- arch/x86/kernel/apic/probe_64.c | 2 +- arch/x86/kernel/apic/x2apic_uv_x.c | 2 +- arch/x86/kernel/cpu/common.c | 2 +- arch/x86/kernel/cpu/hypervisor.c | 3 ++- arch/x86/kernel/cpu/intel.c | 2 +- arch/x86/kernel/cpu/match.c | 2 +- arch/x86/kernel/cpu/mshyperv.c | 3 ++- arch/x86/kernel/cpu/mtrr/cleanup.c | 1 - arch/x86/kernel/cpu/mtrr/generic.c | 2 +- arch/x86/kernel/cpu/mtrr/if.c | 1 - arch/x86/kernel/cpu/mtrr/main.c | 2 +- arch/x86/kernel/cpu/perfctr-watchdog.c | 2 +- arch/x86/kernel/cpu/vmware.c | 3 ++- arch/x86/kernel/crash.c | 2 +- arch/x86/kernel/dumpstack.c | 3 ++- arch/x86/kernel/dumpstack_32.c | 2 +- arch/x86/kernel/dumpstack_64.c | 2 +- arch/x86/kernel/hw_breakpoint.c | 3 ++- arch/x86/kernel/i386_ksyms_32.c | 2 +- arch/x86/kernel/i8253.c | 2 +- arch/x86/kernel/io_delay.c | 2 +- arch/x86/kernel/irq_32.c | 1 - arch/x86/kernel/irq_64.c | 1 - arch/x86/kernel/kdebugfs.c | 2 +- arch/x86/kernel/kvm.c | 2 +- arch/x86/kernel/mpparse.c | 1 - arch/x86/kernel/paravirt-spinlocks.c | 2 +- arch/x86/kernel/paravirt.c | 3 ++- arch/x86/kernel/pci-swiotlb.c | 2 +- arch/x86/kernel/pmem.c | 2 +- arch/x86/kernel/process.c | 3 ++- arch/x86/kernel/process_32.c | 2 +- arch/x86/kernel/process_64.c | 2 +- arch/x86/kernel/reboot.c | 2 +- arch/x86/kernel/setup.c | 2 +- arch/x86/kernel/setup_percpu.c | 2 +- arch/x86/kernel/smpboot.c | 2 +- arch/x86/kernel/stacktrace.c | 2 +- arch/x86/kernel/test_rodata.c | 5 ----- arch/x86/kernel/traps.c | 2 +- arch/x86/kernel/tsc.c | 2 +- arch/x86/kernel/x8664_ksyms_64.c | 2 +- arch/x86/kernel/x86_init.c | 2 +- arch/x86/kvm/cpuid.c | 2 +- arch/x86/kvm/emulate.c | 1 - arch/x86/kvm/iommu.c | 2 +- arch/x86/kvm/irq.c | 2 +- arch/x86/kvm/lapic.c | 2 +- arch/x86/kvm/mmu.c | 3 ++- arch/x86/kvm/x86.c | 3 ++- arch/x86/lib/cache-smp.c | 2 +- arch/x86/lib/cpu.c | 3 ++- arch/x86/lib/csum-partial_64.c | 2 +- arch/x86/lib/csum-wrappers_64.c | 2 +- arch/x86/lib/delay.c | 2 +- arch/x86/lib/memcpy_32.c | 2 +- arch/x86/lib/mmx_32.c | 2 +- arch/x86/lib/msr-reg-export.c | 2 +- arch/x86/lib/msr-smp.c | 2 +- arch/x86/lib/msr.c | 2 +- arch/x86/lib/string_32.c | 2 +- arch/x86/lib/usercopy.c | 2 +- arch/x86/lib/usercopy_32.c | 2 +- arch/x86/lib/usercopy_64.c | 2 +- arch/x86/mm/amdtopology.c | 1 - arch/x86/mm/dump_pagetables.c | 6 +----- arch/x86/mm/highmem_32.c | 2 +- arch/x86/mm/init_32.c | 1 - arch/x86/mm/init_64.c | 1 - arch/x86/mm/iomap_32.c | 2 +- arch/x86/mm/ioremap.c | 1 - arch/x86/mm/kmemcheck/kmemcheck.c | 1 - arch/x86/mm/kmemcheck/shadow.c | 2 +- arch/x86/mm/kmmio.c | 2 +- arch/x86/mm/mmio-mod.c | 2 +- arch/x86/mm/numa.c | 1 - arch/x86/mm/numa_32.c | 2 +- arch/x86/mm/pat.c | 1 - arch/x86/mm/pat_rbtree.c | 1 - arch/x86/mm/pf_in.c | 1 - arch/x86/mm/pgtable_32.c | 1 - arch/x86/mm/physaddr.c | 2 +- arch/x86/mm/srat.c | 2 +- arch/x86/mm/tlb.c | 2 +- arch/x86/pci/xen.c | 2 +- arch/x86/platform/ce4100/ce4100.c | 2 +- arch/x86/platform/efi/efi_64.c | 2 +- arch/x86/platform/intel-mid/intel-mid.c | 2 +- arch/x86/platform/intel-mid/pwr.c | 4 +--- arch/x86/platform/intel-mid/sfi.c | 2 +- arch/x86/platform/olpc/olpc.c | 2 +- arch/x86/platform/olpc/olpc_ofw.c | 2 +- arch/x86/platform/ts5500/ts5500.c | 2 +- arch/x86/platform/uv/uv_irq.c | 2 +- arch/x86/platform/uv/uv_nmi.c | 2 +- arch/x86/um/delay.c | 2 +- arch/x86/xen/debugfs.c | 1 - arch/x86/xen/enlighten.c | 2 +- arch/x86/xen/mmu.c | 3 ++- arch/x86/xen/p2m.c | 2 +- arch/x86/xen/platform-pci-unplug.c | 2 +- arch/x86/xen/setup.c | 2 +- 121 files changed, 112 insertions(+), 131 deletions(-)
Signature · 136 lines
2.8.4 Paul Gortmaker (8): x86: don't use module.h just for AUTHOR / LICENSE tags x86: mm: audit and remove any unnecessary uses of module.h x86: kernel: audit and remove any unnecessary uses of module.h x86: lib: audit and remove any unnecessary uses of module.h x86: platform: audit and remove any unnecessary uses of module.h x86: xen: audit and remove any unnecessary uses of module.h x86: kvm: audit and remove any unnecessary uses of module.h x86: audit and remove any remaining unnecessary uses of module.h arch/x86/crypto/glue_helper.c | 4 +--- arch/x86/events/amd/ibs.c | 3 ++- arch/x86/events/amd/iommu.c | 2 +- arch/x86/events/core.c | 3 ++- arch/x86/events/intel/uncore.c | 2 ++ arch/x86/events/intel/uncore.h | 1 - arch/x86/include/asm/livepatch.h | 1 - arch/x86/include/asm/topology.h | 1 + arch/x86/kernel/acpi/boot.c | 2 +- arch/x86/kernel/acpi/cstate.c | 2 +- arch/x86/kernel/amd_gart_64.c | 1 - arch/x86/kernel/amd_nb.c | 2 +- arch/x86/kernel/apic/apic.c | 2 +- arch/x86/kernel/apic/apic_flat_64.c | 2 +- arch/x86/kernel/apic/apic_noop.c | 1 - arch/x86/kernel/apic/hw_nmi.c | 2 +- arch/x86/kernel/apic/io_apic.c | 2 +- arch/x86/kernel/apic/ipi.c | 1 - arch/x86/kernel/apic/probe_32.c | 2 +- arch/x86/kernel/apic/probe_64.c | 2 +- arch/x86/kernel/apic/x2apic_uv_x.c | 2 +- arch/x86/kernel/cpu/common.c | 2 +- arch/x86/kernel/cpu/hypervisor.c | 3 ++- arch/x86/kernel/cpu/intel.c | 2 +- arch/x86/kernel/cpu/match.c | 2 +- arch/x86/kernel/cpu/mshyperv.c | 3 ++- arch/x86/kernel/cpu/mtrr/cleanup.c | 1 - arch/x86/kernel/cpu/mtrr/generic.c | 2 +- arch/x86/kernel/cpu/mtrr/if.c | 1 - arch/x86/kernel/cpu/mtrr/main.c | 2 +- arch/x86/kernel/cpu/perfctr-watchdog.c | 2 +- arch/x86/kernel/cpu/vmware.c | 3 ++- arch/x86/kernel/crash.c | 2 +- arch/x86/kernel/dumpstack_32.c | 2 +- arch/x86/kernel/dumpstack_64.c | 2 +- arch/x86/kernel/hw_breakpoint.c | 3 ++- arch/x86/kernel/i386_ksyms_32.c | 3 ++- arch/x86/kernel/i8253.c | 2 +- arch/x86/kernel/io_delay.c | 2 +- arch/x86/kernel/irq_32.c | 1 - arch/x86/kernel/irq_64.c | 1 - arch/x86/kernel/kdebugfs.c | 2 +- arch/x86/kernel/kvm.c | 2 +- arch/x86/kernel/mpparse.c | 1 - arch/x86/kernel/paravirt-spinlocks.c | 2 +- arch/x86/kernel/paravirt.c | 3 ++- arch/x86/kernel/pci-swiotlb.c | 2 +- arch/x86/kernel/pmem.c | 2 +- arch/x86/kernel/process.c | 3 ++- arch/x86/kernel/process_32.c | 2 +- arch/x86/kernel/process_64.c | 2 +- arch/x86/kernel/reboot.c | 2 +- arch/x86/kernel/setup.c | 2 +- arch/x86/kernel/setup_percpu.c | 2 +- arch/x86/kernel/smpboot.c | 2 +- arch/x86/kernel/stacktrace.c | 2 +- arch/x86/kernel/test_rodata.c | 5 ----- arch/x86/kernel/traps.c | 2 +- arch/x86/kernel/tsc.c | 2 +- arch/x86/kernel/x8664_ksyms_64.c | 2 +- arch/x86/kernel/x86_init.c | 2 +- arch/x86/kvm/cpuid.c | 2 +- arch/x86/kvm/emulate.c | 1 - arch/x86/kvm/iommu.c | 2 +- arch/x86/kvm/irq.c | 2 +- arch/x86/kvm/lapic.c | 2 +- arch/x86/kvm/mmu.c | 3 ++- arch/x86/kvm/x86.c | 3 ++- arch/x86/lib/cache-smp.c | 2 +- arch/x86/lib/cpu.c | 3 ++- arch/x86/lib/csum-partial_64.c | 2 +- arch/x86/lib/csum-wrappers_64.c | 2 +- arch/x86/lib/delay.c | 2 +- arch/x86/lib/memcpy_32.c | 2 +- arch/x86/lib/mmx_32.c | 2 +- arch/x86/lib/msr-reg-export.c | 2 +- arch/x86/lib/msr-smp.c | 2 +- arch/x86/lib/msr.c | 3 ++- arch/x86/lib/string_32.c | 2 +- arch/x86/lib/usercopy.c | 2 +- arch/x86/lib/usercopy_32.c | 2 +- arch/x86/lib/usercopy_64.c | 2 +- arch/x86/mm/amdtopology.c | 1 - arch/x86/mm/dump_pagetables.c | 6 +----- arch/x86/mm/highmem_32.c | 2 +- arch/x86/mm/init_32.c | 1 - arch/x86/mm/init_64.c | 1 - arch/x86/mm/iomap_32.c | 2 +- arch/x86/mm/ioremap.c | 1 - arch/x86/mm/kmemcheck/kmemcheck.c | 1 - arch/x86/mm/kmemcheck/shadow.c | 2 +- arch/x86/mm/kmmio.c | 2 +- arch/x86/mm/mmio-mod.c | 2 +- arch/x86/mm/numa.c | 1 - arch/x86/mm/numa_32.c | 2 +- arch/x86/mm/pat.c | 1 - arch/x86/mm/pat_rbtree.c | 1 - arch/x86/mm/pf_in.c | 1 - arch/x86/mm/pgtable_32.c | 1 - arch/x86/mm/physaddr.c | 2 +- arch/x86/mm/srat.c | 2 +- arch/x86/mm/tlb.c | 2 +- arch/x86/pci/xen.c | 2 +- arch/x86/platform/ce4100/ce4100.c | 2 +- arch/x86/platform/efi/efi_64.c | 2 +- arch/x86/platform/intel-mid/intel-mid.c | 2 +- arch/x86/platform/intel-mid/pwr.c | 4 +--- arch/x86/platform/intel-mid/sfi.c | 2 +- arch/x86/platform/olpc/olpc.c | 2 +- arch/x86/platform/olpc/olpc_ofw.c | 5 ++++- arch/x86/platform/ts5500/ts5500.c | 2 +- arch/x86/platform/uv/uv_irq.c | 2 +- arch/x86/platform/uv/uv_nmi.c | 2 +- arch/x86/um/delay.c | 2 +- arch/x86/xen/debugfs.c | 1 - arch/x86/xen/enlighten.c | 2 +- arch/x86/xen/mmu.c | 3 ++- arch/x86/xen/p2m.c | 2 +- arch/x86/xen/platform-pci-unplug.c | 2 +- arch/x86/xen/setup.c | 2 +- 120 files changed, 115 insertions(+), 130 deletions(-) -- 2.8.4
PATCH 1/8 x86: don't use module.h just for AUTHOR / LICENSE tags
The Kconfig controlling compilation of these files are:
arch/x86/Kconfig.debug:config DEBUG_RODATA_TEST arch/x86/Kconfig.debug: bool "Testcase for the marking rodata read-only"
arch/x86/Kconfig.debug:config X86_PTDUMP_COREarch/x86/Kconfig.debug: def_bool n
...meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only.
We delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.
--- arch/x86/kernel/test_rodata.c | 5 ----- arch/x86/mm/dump_pagetables.c | 6 +----- 2 files changed, 1 insertion(+), 10 deletions(-)
arch/x86/kernel/test_rodata.c +0 -5
@@ -9,7 +9,6 @@* as published by the Free Software Foundation; version 2 * of the License. */ -#include <linux/module.h> #include <asm/cacheflush.h> #include <asm/sections.h> #include <asm/asm.h>
@@ -74,7 +73,3 @@ int rodata_test(void)return 0 ; } - -MODULE_LICENSE ("GPL" ); -MODULE_DESCRIPTION ("Testcase for marking rodata as read-only" ); -MODULE_AUTHOR ("Arjan van de Ven <[email protected]>" );
arch/x86/mm/dump_pagetables.c +1 -5
@@ -14,7 +14,7 @@#include <linux/debugfs.h> #include <linux/mm.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/seq_file.h> #include <asm/pgtable.h>
@@ -454,8 +454,4 @@ static int __init pt_dump_init(void)return 0 ; } -__initcall (pt_dump_init); -MODULE_LICENSE ("GPL" ); -MODULE_AUTHOR ("Arjan van de Ven <[email protected]>" ); -MODULE_DESCRIPTION ("Kernel debugging helper that dumps pagetables" );
Signature · 1 line
2.8.4
Re: [PATCH 1/8] x86: don't use module.h just for AUTHOR / LICENSE tags
Quoted 10 lines · Paul Gortmaker
The
Kconfigcontrolling compilation of these files are:arch/x86/Kconfig.debug:config
DEBUG_RODATA_TESTarch/x86/Kconfig.debug: bool "Testcase for the marking rodata read-only"arch/x86/Kconfig.debug:config
X86_PTDUMP_COREarch/x86/Kconfig.debug:def_booln...meaning that it currently is not being built as a module by anyone.
Quoted 7 lines
Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only.
We delete the
MODULE_LICENSEtag etc. since all that information is already contained at the top of the file in the comments.Cc Arjan van de Ven <[email protected]>
original these were tested as modules, but they really shouldn't be modules in the normal kernel (and aren't per Kconfig)
tip-bot for Paul Gortmaker
merge bot[tip:x86/headers] x86: Don't use module.h just for AUTHOR / LICENSE tags
In reply to Paul Gortmakerx86: Don't use module.h just for AUTHOR / LICENSE tags
Commit-ID: 84e629b66882f8d1b6e40060e85e5bb27c892d42 Gitweb: http://git.kernel.org/tip/84e629b66882f8d1b6e40060e85e5bb27c892d42 Author: Paul Gortmaker <[email protected]> AuthorDate: Wed, 13 Jul 2016 20:18:54 -0400 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 14 Jul 2016 13:04:20 +0200
x86: Don't use module.h just for AUTHOR / LICENSE tags
The Kconfig controlling compilation of these files are:
arch/x86/Kconfig.debug:config DEBUG_RODATA_TEST arch/x86/Kconfig.debug: bool "Testcase for the marking rodata read-only"
arch/x86/Kconfig.debug:config X86_PTDUMP_CORE
arch/x86/Kconfig.debug: def_bool n
...meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only.
We delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.
--- arch/x86/kernel/test_rodata.c | 5 ----- arch/x86/mm/dump_pagetables.c | 6 +----- 2 files changed, 1 insertion(+), 10 deletions(-)
arch/x86/kernel/test_rodata.c +0 -5
@@ -9,7 +9,6 @@* as published by the Free Software Foundation; version 2 * of the License. */ -#include <linux/module.h> #include <asm/cacheflush.h> #include <asm/sections.h> #include <asm/asm.h>
@@ -74,7 +73,3 @@ int rodata_test(void)return 0 ; } - -MODULE_LICENSE ("GPL" ); -MODULE_DESCRIPTION ("Testcase for marking rodata as read-only" ); -MODULE_AUTHOR ("Arjan van de Ven <[email protected]>" );
arch/x86/mm/dump_pagetables.c +1 -5
@@ -14,7 +14,7 @@#include <linux/debugfs.h> #include <linux/mm.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/seq_file.h> #include <asm/pgtable.h>
@@ -446,8 +446,4 @@ static int __init pt_dump_init(void)return 0 ; } -__initcall (pt_dump_init); -MODULE_LICENSE ("GPL" ); -MODULE_AUTHOR ("Arjan van de Ven <[email protected]>" ); -MODULE_DESCRIPTION ("Kernel debugging helper that dumps pagetables" );
PATCH 2/8 x86: mm: audit and remove any unnecessary uses of module.h
In reply to Paul GortmakerHistorically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. The advantage in doing so is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.
Since module.h was the source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each obj-y/bool instance for the presence of either and replace accordingly where needed.
Note that some bool/obj-y instances remain since module.h is the header for some exception table entry stuff, and for things like __init_or_module (code that is tossed when MODULES=n).
--- arch/x86/mm/amdtopology.c | 1 - arch/x86/mm/highmem_32.c | 2 +- arch/x86/mm/init_32.c | 1 - arch/x86/mm/init_64.c | 1 - arch/x86/mm/iomap_32.c | 2 +- arch/x86/mm/ioremap.c | 1 - arch/x86/mm/kmemcheck/kmemcheck.c | 1 - arch/x86/mm/kmemcheck/shadow.c | 2 +- arch/x86/mm/kmmio.c | 2 +- arch/x86/mm/mmio-mod.c | 2 +- arch/x86/mm/numa.c | 1 - arch/x86/mm/numa_32.c | 2 +- arch/x86/mm/pat.c | 1 - arch/x86/mm/pat_rbtree.c | 1 - arch/x86/mm/pf_in.c | 1 - arch/x86/mm/pgtable_32.c | 1 - arch/x86/mm/physaddr.c | 2 +- arch/x86/mm/srat.c | 2 +- arch/x86/mm/tlb.c | 2 +- 19 files changed, 9 insertions(+), 19 deletions(-)
arch/x86/mm/amdtopology.c +0 -1
@@ -9,7 +9,6 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/string.h> -#include <linux/module.h> #include <linux/nodemask.h> #include <linux/memblock.h> #include <linux/bootmem.h>
arch/x86/mm/highmem_32.c +1 -1
@@ -1,5 +1,5 @@#include <linux/highmem.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/swap.h> /* for totalram_pages */ #include <linux/bootmem.h>
arch/x86/mm/init_32.c +0 -1
@@ -5,7 +5,6 @@* Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999 */ -#include <linux/module.h> #include <linux/signal.h> #include <linux/sched.h> #include <linux/kernel.h>
arch/x86/mm/init_64.c +0 -1
@@ -27,7 +27,6 @@#include <linux/pfn.h> #include <linux/poison.h> #include <linux/dma-mapping.h> -#include <linux/module.h> #include <linux/memory.h> #include <linux/memory_hotplug.h> #include <linux/memremap.h>
arch/x86/mm/iomap_32.c +1 -1
@@ -18,7 +18,7 @@#include <asm/iomap.h> #include <asm/pat.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/highmem.h> static int is_io_mapping_possible (resource_size_t base,unsigned long size)
arch/x86/mm/ioremap.c +0 -1
@@ -9,7 +9,6 @@#include <linux/bootmem.h> #include <linux/init.h> #include <linux/io.h> -#include <linux/module.h> #include <linux/slab.h> #include <linux/vmalloc.h> #include <linux/mmiotrace.h>
arch/x86/mm/kmemcheck/kmemcheck.c +0 -1
@@ -14,7 +14,6 @@#include <linux/kernel.h> #include <linux/kmemcheck.h> #include <linux/mm.h> -#include <linux/module.h> #include <linux/page-flags.h> #include <linux/percpu.h> #include <linux/ptrace.h>
arch/x86/mm/kmemcheck/shadow.c +1 -1
@@ -1,5 +1,5 @@#include <linux/kmemcheck.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/mm.h> #include <asm/page.h>
arch/x86/mm/kmmio.c +1 -1
@@ -11,7 +11,7 @@#include <linux/rculist.h> #include <linux/spinlock.h> #include <linux/hash.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/kernel.h> #include <linux/uaccess.h> #include <linux/ptrace.h>
arch/x86/mm/mmio-mod.c +1 -1
@@ -24,7 +24,7 @@#define DEBUG 1 -#include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/debugfs.h> #include <linux/slab.h> #include <linux/uaccess.h>
arch/x86/mm/numa.c +0 -1
@@ -8,7 +8,6 @@#include <linux/memblock.h> #include <linux/mmzone.h> #include <linux/ctype.h> -#include <linux/module.h> #include <linux/nodemask.h> #include <linux/sched.h> #include <linux/topology.h>
arch/x86/mm/numa_32.c +1 -1
@@ -24,7 +24,7 @@#include <linux/bootmem.h> #include <linux/memblock.h> -#include <linux/module.h> +#include <linux/init.h> #include "numa_internal.h"
arch/x86/mm/pat.c +0 -1
@@ -11,7 +11,6 @@#include <linux/bootmem.h> #include <linux/debugfs.h> #include <linux/kernel.h> -#include <linux/module.h> #include <linux/pfn_t.h> #include <linux/slab.h> #include <linux/mm.h>
arch/x86/mm/pat_rbtree.c +0 -1
@@ -11,7 +11,6 @@#include <linux/seq_file.h> #include <linux/debugfs.h> #include <linux/kernel.h> -#include <linux/module.h> #include <linux/rbtree_augmented.h> #include <linux/sched.h> #include <linux/gfp.h>
arch/x86/mm/pf_in.c +0 -1
@@ -26,7 +26,6 @@* Bjorn Steinbrink ([email protected]), 2007 */ -#include <linux/module.h> #include <linux/ptrace.h> /* struct pt_regs */ #include "pf_in.h"
arch/x86/mm/pgtable_32.c +0 -1
@@ -8,7 +8,6 @@#include <linux/highmem.h> #include <linux/pagemap.h> #include <linux/spinlock.h> -#include <linux/module.h> #include <asm/pgtable.h> #include <asm/pgalloc.h>
arch/x86/mm/physaddr.c +1 -1
@@ -1,6 +1,6 @@#include <linux/bootmem.h> #include <linux/mmdebug.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/mm.h> #include <asm/page.h>
arch/x86/mm/srat.c +1 -1
@@ -13,7 +13,7 @@#include <linux/acpi.h> #include <linux/mmzone.h> #include <linux/bitmap.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/topology.h> #include <linux/mm.h> #include <asm/proto.h>
arch/x86/mm/tlb.c +1 -1
@@ -4,7 +4,7 @@#include <linux/spinlock.h> #include <linux/smp.h> #include <linux/interrupt.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/cpu.h> #include <asm/tlbflush.h>
Signature · 1 line
2.8.4
tip-bot for Paul Gortmaker
merge bot[tip:x86/headers] x86/mm: Audit and remove any unnecessary uses of module.h
x86/mm: Audit and remove any unnecessary uses of module.h
Commit-ID: 4b599fedb7eeea4c995e655a938b5ec419386ddf Gitweb: http://git.kernel.org/tip/4b599fedb7eeea4c995e655a938b5ec419386ddf Author: Paul Gortmaker <[email protected]> AuthorDate: Wed, 13 Jul 2016 20:18:55 -0400 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 14 Jul 2016 13:04:20 +0200
x86/mm: Audit and remove any unnecessary uses of module.h
Historically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. The advantage in doing so is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.
Since module.h was the source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each obj-y/bool instance for the presence of either and replace accordingly where needed.
Note that some bool/obj-y instances remain since module.h is the header for some exception table entry stuff, and for things like __init_or_module (code that is tossed when MODULES=n).
--- arch/x86/mm/amdtopology.c | 1 - arch/x86/mm/highmem_32.c | 2 +- arch/x86/mm/init_32.c | 1 - arch/x86/mm/init_64.c | 1 - arch/x86/mm/iomap_32.c | 2 +- arch/x86/mm/ioremap.c | 1 - arch/x86/mm/kmemcheck/kmemcheck.c | 1 - arch/x86/mm/kmemcheck/shadow.c | 2 +- arch/x86/mm/kmmio.c | 2 +- arch/x86/mm/mmio-mod.c | 2 +- arch/x86/mm/numa.c | 1 - arch/x86/mm/numa_32.c | 2 +- arch/x86/mm/pat.c | 1 - arch/x86/mm/pat_rbtree.c | 1 - arch/x86/mm/pf_in.c | 1 - arch/x86/mm/pgtable_32.c | 1 - arch/x86/mm/physaddr.c | 2 +- arch/x86/mm/srat.c | 2 +- arch/x86/mm/tlb.c | 2 +- 19 files changed, 9 insertions(+), 19 deletions(-)
arch/x86/mm/amdtopology.c +0 -1
@@ -9,7 +9,6 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/string.h> -#include <linux/module.h> #include <linux/nodemask.h> #include <linux/memblock.h> #include <linux/bootmem.h>
arch/x86/mm/highmem_32.c +1 -1
@@ -1,5 +1,5 @@#include <linux/highmem.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/swap.h> /* for totalram_pages */ #include <linux/bootmem.h>
arch/x86/mm/init_32.c +0 -1
@@ -5,7 +5,6 @@* Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999 */ -#include <linux/module.h> #include <linux/signal.h> #include <linux/sched.h> #include <linux/kernel.h>
arch/x86/mm/init_64.c +0 -1
@@ -27,7 +27,6 @@#include <linux/pfn.h> #include <linux/poison.h> #include <linux/dma-mapping.h> -#include <linux/module.h> #include <linux/memory.h> #include <linux/memory_hotplug.h> #include <linux/memremap.h>
arch/x86/mm/iomap_32.c +1 -1
@@ -18,7 +18,7 @@#include <asm/iomap.h> #include <asm/pat.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/highmem.h> static int is_io_mapping_possible (resource_size_t base,unsigned long size)
arch/x86/mm/ioremap.c +0 -1
@@ -9,7 +9,6 @@#include <linux/bootmem.h> #include <linux/init.h> #include <linux/io.h> -#include <linux/module.h> #include <linux/slab.h> #include <linux/vmalloc.h> #include <linux/mmiotrace.h>
arch/x86/mm/kmemcheck/kmemcheck.c +0 -1
@@ -14,7 +14,6 @@#include <linux/kernel.h> #include <linux/kmemcheck.h> #include <linux/mm.h> -#include <linux/module.h> #include <linux/page-flags.h> #include <linux/percpu.h> #include <linux/ptrace.h>
arch/x86/mm/kmemcheck/shadow.c +1 -1
@@ -1,5 +1,5 @@#include <linux/kmemcheck.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/mm.h> #include <asm/page.h>
arch/x86/mm/kmmio.c +1 -1
@@ -11,7 +11,7 @@#include <linux/rculist.h> #include <linux/spinlock.h> #include <linux/hash.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/kernel.h> #include <linux/uaccess.h> #include <linux/ptrace.h>
arch/x86/mm/mmio-mod.c +1 -1
@@ -24,7 +24,7 @@#define DEBUG 1 -#include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/debugfs.h> #include <linux/slab.h> #include <linux/uaccess.h>
arch/x86/mm/numa.c +0 -1
@@ -7,7 +7,6 @@#include <linux/memblock.h> #include <linux/mmzone.h> #include <linux/ctype.h> -#include <linux/module.h> #include <linux/nodemask.h> #include <linux/sched.h> #include <linux/topology.h>
arch/x86/mm/numa_32.c +1 -1
@@ -24,7 +24,7 @@#include <linux/bootmem.h> #include <linux/memblock.h> -#include <linux/module.h> +#include <linux/init.h> #include "numa_internal.h"
arch/x86/mm/pat.c +0 -1
@@ -11,7 +11,6 @@#include <linux/bootmem.h> #include <linux/debugfs.h> #include <linux/kernel.h> -#include <linux/module.h> #include <linux/pfn_t.h> #include <linux/slab.h> #include <linux/mm.h>
arch/x86/mm/pat_rbtree.c +0 -1
@@ -11,7 +11,6 @@#include <linux/seq_file.h> #include <linux/debugfs.h> #include <linux/kernel.h> -#include <linux/module.h> #include <linux/rbtree_augmented.h> #include <linux/sched.h> #include <linux/gfp.h>
arch/x86/mm/pf_in.c +0 -1
@@ -26,7 +26,6 @@* Bjorn Steinbrink ([email protected]), 2007 */ -#include <linux/module.h> #include <linux/ptrace.h> /* struct pt_regs */ #include "pf_in.h"
arch/x86/mm/pgtable_32.c +0 -1
@@ -8,7 +8,6 @@#include <linux/highmem.h> #include <linux/pagemap.h> #include <linux/spinlock.h> -#include <linux/module.h> #include <asm/pgtable.h> #include <asm/pgalloc.h>
arch/x86/mm/physaddr.c +1 -1
@@ -1,6 +1,6 @@#include <linux/bootmem.h> #include <linux/mmdebug.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/mm.h> #include <asm/page.h>
arch/x86/mm/srat.c +1 -1
@@ -13,7 +13,7 @@#include <linux/acpi.h> #include <linux/mmzone.h> #include <linux/bitmap.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/topology.h> #include <linux/bootmem.h> #include <linux/memblock.h>
arch/x86/mm/tlb.c +1 -1
@@ -4,7 +4,7 @@#include <linux/spinlock.h> #include <linux/smp.h> #include <linux/interrupt.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/cpu.h> #include <asm/tlbflush.h>
PATCH 3/8 x86: kernel: audit and remove any unnecessary uses of module.h
In reply to Paul GortmakerHistorically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. The advantage in doing so is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.
Since module.h was the source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each obj-y/bool instance for the presence of either and replace as needed. Build testing revealed some implicit header usage that was fixed up accordingly.
Note that some bool/obj-y instances remain since module.h is the header for some exception table entry stuff, and for things like __init_or_module (code that is tossed when MODULES=n).
--- arch/x86/include/asm/topology.h | 1 + arch/x86/kernel/acpi/boot.c | 2 +- arch/x86/kernel/acpi/cstate.c | 2 +- arch/x86/kernel/amd_gart_64.c | 1 - arch/x86/kernel/amd_nb.c | 2 +- arch/x86/kernel/apic/apic.c | 2 +- arch/x86/kernel/apic/apic_flat_64.c | 2 +- arch/x86/kernel/apic/apic_noop.c | 1 - arch/x86/kernel/apic/hw_nmi.c | 2 +- arch/x86/kernel/apic/io_apic.c | 2 +- arch/x86/kernel/apic/ipi.c | 1 - arch/x86/kernel/apic/probe_32.c | 2 +- arch/x86/kernel/apic/probe_64.c | 2 +- arch/x86/kernel/apic/x2apic_uv_x.c | 2 +- arch/x86/kernel/cpu/common.c | 2 +- arch/x86/kernel/cpu/hypervisor.c | 3 ++- arch/x86/kernel/cpu/intel.c | 2 +- arch/x86/kernel/cpu/match.c | 2 +- arch/x86/kernel/cpu/mshyperv.c | 3 ++- arch/x86/kernel/cpu/mtrr/cleanup.c | 1 - arch/x86/kernel/cpu/mtrr/generic.c | 2 +- arch/x86/kernel/cpu/perfctr-watchdog.c | 2 +- arch/x86/kernel/cpu/vmware.c | 3 ++- arch/x86/kernel/crash.c | 2 +- arch/x86/kernel/dumpstack_32.c | 2 +- arch/x86/kernel/dumpstack_64.c | 2 +- arch/x86/kernel/hw_breakpoint.c | 3 ++- arch/x86/kernel/i386_ksyms_32.c | 3 ++- arch/x86/kernel/i8253.c | 2 +- arch/x86/kernel/io_delay.c | 2 +- arch/x86/kernel/irq_32.c | 1 - arch/x86/kernel/irq_64.c | 1 - arch/x86/kernel/kdebugfs.c | 2 +- arch/x86/kernel/kvm.c | 2 +- arch/x86/kernel/mpparse.c | 1 - arch/x86/kernel/paravirt-spinlocks.c | 2 +- arch/x86/kernel/paravirt.c | 3 ++- arch/x86/kernel/pci-swiotlb.c | 2 +- arch/x86/kernel/pmem.c | 2 +- arch/x86/kernel/process.c | 3 ++- arch/x86/kernel/process_32.c | 2 +- arch/x86/kernel/process_64.c | 2 +- arch/x86/kernel/reboot.c | 2 +- arch/x86/kernel/setup.c | 2 +- arch/x86/kernel/setup_percpu.c | 2 +- arch/x86/kernel/smpboot.c | 2 +- arch/x86/kernel/stacktrace.c | 2 +- arch/x86/kernel/traps.c | 2 +- arch/x86/kernel/tsc.c | 2 +- arch/x86/kernel/x8664_ksyms_64.c | 2 +- arch/x86/kernel/x86_init.c | 2 +- 51 files changed, 51 insertions(+), 50 deletions(-)
arch/x86/include/asm/topology.h +1 -0
@@ -36,6 +36,7 @@#include <linux/cpumask.h> #include <asm/mpspec.h> +#include <asm/percpu.h> /* Mappings between logical cpu number and node number */ DECLARE_EARLY_PER_CPU (int, x86_cpu_to_node_map);
arch/x86/kernel/acpi/boot.c +1 -1
@@ -28,7 +28,7 @@#include <linux/acpi_pmtmr.h> #include <linux/efi.h> #include <linux/cpumask.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/dmi.h> #include <linux/irq.h> #include <linux/slab.h>
arch/x86/kernel/acpi/cstate.c +1 -1
@@ -5,7 +5,7 @@*/ #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/init.h> #include <linux/acpi.h> #include <linux/cpu.h>
arch/x86/kernel/amd_gart_64.c +0 -1
@@ -20,7 +20,6 @@#include <linux/string.h> #include <linux/spinlock.h> #include <linux/pci.h> -#include <linux/module.h> #include <linux/topology.h> #include <linux/interrupt.h> #include <linux/bitmap.h>
arch/x86/kernel/amd_nb.c +1 -1
@@ -9,7 +9,7 @@#include <linux/slab.h> #include <linux/init.h> #include <linux/errno.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/spinlock.h> #include <asm/amd_nb.h>
arch/x86/kernel/apic/apic.c +1 -1
@@ -23,7 +23,7 @@#include <linux/bootmem.h> #include <linux/ftrace.h> #include <linux/ioport.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/syscore_ops.h> #include <linux/delay.h> #include <linux/timex.h>
arch/x86/kernel/apic/apic_flat_64.c +1 -1
@@ -15,7 +15,7 @@#include <linux/kernel.h> #include <linux/ctype.h> #include <linux/hardirq.h> -#include <linux/module.h> +#include <linux/export.h> #include <asm/smp.h> #include <asm/apic.h> #include <asm/ipi.h>
arch/x86/kernel/apic/apic_noop.c +0 -1
@@ -11,7 +11,6 @@#include <linux/threads.h> #include <linux/cpumask.h> -#include <linux/module.h> #include <linux/string.h> #include <linux/kernel.h> #include <linux/ctype.h>
arch/x86/kernel/apic/hw_nmi.c +1 -1
@@ -16,7 +16,7 @@#include <linux/notifier.h> #include <linux/kprobes.h> #include <linux/nmi.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/delay.h> #ifdef CONFIG_HARDLOCKUP_DETECTOR
arch/x86/kernel/apic/io_apic.c +1 -1
@@ -39,7 +39,7 @@#include <linux/mc146818rtc.h> #include <linux/compiler.h> #include <linux/acpi.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/syscore_ops.h> #include <linux/freezer.h> #include <linux/kthread.h>
arch/x86/kernel/apic/ipi.c +0 -1
@@ -8,7 +8,6 @@#include <linux/mc146818rtc.h> #include <linux/cache.h> #include <linux/cpu.h> -#include <linux/module.h> #include <asm/smp.h> #include <asm/mtrr.h>
arch/x86/kernel/apic/probe_32.c +1 -1
@@ -8,7 +8,7 @@*/ #include <linux/threads.h> #include <linux/cpumask.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/string.h> #include <linux/kernel.h> #include <linux/ctype.h>
arch/x86/kernel/apic/probe_64.c +1 -1
@@ -11,7 +11,7 @@#include <linux/threads.h> #include <linux/cpumask.h> #include <linux/string.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/kernel.h> #include <linux/ctype.h> #include <linux/init.h>
arch/x86/kernel/apic/x2apic_uv_x.c +1 -1
@@ -12,7 +12,7 @@#include <linux/proc_fs.h> #include <linux/threads.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/string.h> #include <linux/ctype.h> #include <linux/sched.h>
arch/x86/kernel/cpu/common.c +1 -1
@@ -2,7 +2,7 @@#include <linux/linkage.h> #include <linux/bitops.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/percpu.h> #include <linux/string.h> #include <linux/ctype.h>
arch/x86/kernel/cpu/hypervisor.c +2 -1
@@ -21,7 +21,8 @@* */ -#include <linux/module.h> +#include <linux/init.h> +#include <linux/export.h> #include <asm/processor.h> #include <asm/hypervisor.h>
arch/x86/kernel/cpu/intel.c +1 -1
@@ -5,7 +5,7 @@#include <linux/smp.h> #include <linux/sched.h> #include <linux/thread_info.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/uaccess.h> #include <asm/cpufeature.h>
arch/x86/kernel/cpu/match.c +1 -1
@@ -1,7 +1,7 @@#include <asm/cpu_device_id.h> #include <asm/cpufeature.h> #include <linux/cpu.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/slab.h> /**
arch/x86/kernel/cpu/mshyperv.c +2 -1
@@ -13,7 +13,8 @@#include <linux/types.h> #include <linux/time.h> #include <linux/clocksource.h> -#include <linux/module.h> +#include <linux/init.h> +#include <linux/export.h> #include <linux/hardirq.h> #include <linux/efi.h> #include <linux/interrupt.h>
arch/x86/kernel/cpu/mtrr/cleanup.c +0 -1
@@ -17,7 +17,6 @@* License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/module.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/smp.h>
arch/x86/kernel/cpu/mtrr/generic.c +1 -1
@@ -4,7 +4,7 @@*/ #define DEBUG -#include <linux/module.h> +#include <linux/export.h> #include <linux/init.h> #include <linux/io.h> #include <linux/mm.h>
arch/x86/kernel/cpu/perfctr-watchdog.c +1 -1
@@ -12,7 +12,7 @@*/ #include <linux/percpu.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/kernel.h> #include <linux/bitops.h> #include <linux/smp.h>
arch/x86/kernel/cpu/vmware.c +2 -1
@@ -22,7 +22,8 @@*/ #include <linux/dmi.h> -#include <linux/module.h> +#include <linux/init.h> +#include <linux/export.h> #include <asm/div64.h> #include <asm/x86_init.h> #include <asm/hypervisor.h>
arch/x86/kernel/crash.c +1 -1
@@ -20,7 +20,7 @@#include <linux/delay.h> #include <linux/elf.h> #include <linux/elfcore.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/slab.h> #include <linux/vmalloc.h>
arch/x86/kernel/dumpstack_32.c +1 -1
@@ -7,7 +7,7 @@#include <linux/uaccess.h> #include <linux/hardirq.h> #include <linux/kdebug.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/ptrace.h> #include <linux/kexec.h> #include <linux/sysfs.h>
arch/x86/kernel/dumpstack_64.c +1 -1
@@ -7,7 +7,7 @@#include <linux/uaccess.h> #include <linux/hardirq.h> #include <linux/kdebug.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/ptrace.h> #include <linux/kexec.h> #include <linux/sysfs.h>
arch/x86/kernel/hw_breakpoint.c +2 -1
@@ -36,13 +36,14 @@#include <linux/percpu.h> #include <linux/kdebug.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/sched.h> #include <linux/smp.h> #include <asm/hw_breakpoint.h> #include <asm/processor.h> #include <asm/debugreg.h> +#include <asm/user.h> /* Per cpu debug control register value */ DEFINE_PER_CPU(unsigned long, cpu_dr7);
arch/x86/kernel/i386_ksyms_32.c +2 -1
@@ -1,4 +1,5 @@ -#include <linux/module.h> +#include <linux/export.h> +#include <linux/spinlock_types.h> #include <asm/checksum.h> #include <asm/pgtable.h>
arch/x86/kernel/i8253.c +1 -1
@@ -3,7 +3,7 @@* */ #include <linux/clockchips.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/timex.h> #include <linux/i8253.h>
arch/x86/kernel/io_delay.c +1 -1
@@ -6,7 +6,7 @@* outb_p/inb_p API uses. */ #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/delay.h> #include <linux/init.h> #include <linux/dmi.h>
arch/x86/kernel/irq_32.c +0 -1
@@ -8,7 +8,6 @@* io_apic.c.) */ -#include <linux/module.h> #include <linux/seq_file.h> #include <linux/interrupt.h> #include <linux/kernel_stat.h>
arch/x86/kernel/irq_64.c +0 -1
@@ -11,7 +11,6 @@#include <linux/kernel_stat.h> #include <linux/interrupt.h> #include <linux/seq_file.h> -#include <linux/module.h> #include <linux/delay.h> #include <linux/ftrace.h> #include <linux/uaccess.h>
arch/x86/kernel/kdebugfs.c +1 -1
@@ -8,7 +8,7 @@*/ #include <linux/debugfs.h> #include <linux/uaccess.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/slab.h> #include <linux/init.h> #include <linux/stat.h>
arch/x86/kernel/kvm.c +1 -1
@@ -21,7 +21,7 @@*/ #include <linux/context_tracking.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/kernel.h> #include <linux/kvm_para.h> #include <linux/cpu.h>
arch/x86/kernel/mpparse.c +0 -1
@@ -16,7 +16,6 @@#include <linux/mc146818rtc.h> #include <linux/bitops.h> #include <linux/acpi.h> -#include <linux/module.h> #include <linux/smp.h> #include <linux/pci.h>
arch/x86/kernel/paravirt-spinlocks.c +1 -1
@@ -3,7 +3,7 @@* compiled in a FTRACE-compatible way. */ #include <linux/spinlock.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/jump_label.h> #include <asm/paravirt.h>
arch/x86/kernel/paravirt.c +2 -1
@@ -19,7 +19,8 @@*/ #include <linux/errno.h> -#include <linux/module.h> +#include <linux/init.h> +#include <linux/export.h> #include <linux/efi.h> #include <linux/bcd.h> #include <linux/highmem.h>
arch/x86/kernel/pci-swiotlb.c +1 -1
@@ -2,7 +2,7 @@#include <linux/pci.h> #include <linux/cache.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/swiotlb.h> #include <linux/bootmem.h> #include <linux/dma-mapping.h>
arch/x86/kernel/pmem.c +1 -1
@@ -3,7 +3,7 @@* Copyright (c) 2015, Intel Corporation. */ #include <linux/platform_device.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/ioport.h> static int found (u64 start,u64 end,void *data)
arch/x86/kernel/process.c +2 -1
@@ -7,7 +7,8 @@#include <linux/prctl.h> #include <linux/slab.h> #include <linux/sched.h> -#include <linux/module.h> +#include <linux/init.h> +#include <linux/export.h> #include <linux/pm.h> #include <linux/tick.h> #include <linux/random.h>
arch/x86/kernel/process_32.c +1 -1
@@ -25,7 +25,7 @@#include <linux/delay.h> #include <linux/reboot.h> #include <linux/mc146818rtc.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/kallsyms.h> #include <linux/ptrace.h> #include <linux/personality.h>
arch/x86/kernel/process_64.c +1 -1
@@ -26,7 +26,7 @@#include <linux/user.h> #include <linux/interrupt.h> #include <linux/delay.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/ptrace.h> #include <linux/notifier.h> #include <linux/kprobes.h>
arch/x86/kernel/reboot.c +1 -1
@@ -1,6 +1,6 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt -#include <linux/module.h> +#include <linux/export.h> #include <linux/reboot.h> #include <linux/init.h> #include <linux/pm.h>
arch/x86/kernel/setup.c +1 -1
@@ -36,7 +36,7 @@#include <linux/console.h> #include <linux/root_dev.h> #include <linux/highmem.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/efi.h> #include <linux/init.h> #include <linux/edd.h>
arch/x86/kernel/setup_percpu.c +1 -1
@@ -1,7 +1,7 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt#include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/init.h> #include <linux/bootmem.h> #include <linux/percpu.h>
arch/x86/kernel/smpboot.c +1 -1
@@ -43,7 +43,7 @@#include <linux/init.h> #include <linux/smp.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/sched.h> #include <linux/percpu.h> #include <linux/bootmem.h>
arch/x86/kernel/stacktrace.c +1 -1
@@ -5,7 +5,7 @@*/ #include <linux/sched.h> #include <linux/stacktrace.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/uaccess.h> #include <asm/stacktrace.h>
arch/x86/kernel/traps.c +1 -1
@@ -21,7 +21,7 @@#include <linux/kdebug.h> #include <linux/kgdb.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/ptrace.h> #include <linux/uprobes.h> #include <linux/string.h>
arch/x86/kernel/tsc.c +1 -1
@@ -3,7 +3,7 @@#include <linux/kernel.h> #include <linux/sched.h> #include <linux/init.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/timer.h> #include <linux/acpi_pmtmr.h> #include <linux/cpufreq.h>
arch/x86/kernel/x8664_ksyms_64.c +1 -1
@@ -1,7 +1,7 @@/* Exports for assembly files. All C exports should go in the respective C files. */ -#include <linux/module.h> +#include <linux/export.h> #include <linux/smp.h> #include <net/checksum.h>
arch/x86/kernel/x86_init.c +1 -1
@@ -5,7 +5,7 @@*/ #include <linux/init.h> #include <linux/ioport.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/pci.h> #include <asm/bios_ebda.h>
Signature · 1 line
2.8.4
tip-bot for Paul Gortmaker
merge bot[tip:x86/headers] x86/kernel: Audit and remove any unnecessary uses of module.h
x86/kernel: Audit and remove any unnecessary uses of module.h
Commit-ID: 186f43608a5c827f8284fe4559225b4dccaa49ef Gitweb: http://git.kernel.org/tip/186f43608a5c827f8284fe4559225b4dccaa49ef Author: Paul Gortmaker <[email protected]> AuthorDate: Wed, 13 Jul 2016 20:18:56 -0400 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 14 Jul 2016 15:06:41 +0200
x86/kernel: Audit and remove any unnecessary uses of module.h
Historically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. The advantage in doing so is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.
Since module.h was the source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each obj-y/bool instance for the presence of either and replace as needed. Build testing revealed some implicit header usage that was fixed up accordingly.
Note that some bool/obj-y instances remain since module.h is the header for some exception table entry stuff, and for things like __init_or_module (code that is tossed when MODULES=n).
--- arch/x86/include/asm/topology.h | 1 + arch/x86/kernel/acpi/boot.c | 2 +- arch/x86/kernel/acpi/cstate.c | 2 +- arch/x86/kernel/amd_gart_64.c | 1 - arch/x86/kernel/amd_nb.c | 2 +- arch/x86/kernel/apic/apic.c | 2 +- arch/x86/kernel/apic/apic_flat_64.c | 2 +- arch/x86/kernel/apic/apic_noop.c | 1 - arch/x86/kernel/apic/hw_nmi.c | 2 +- arch/x86/kernel/apic/io_apic.c | 2 +- arch/x86/kernel/apic/ipi.c | 1 - arch/x86/kernel/apic/probe_32.c | 2 +- arch/x86/kernel/apic/probe_64.c | 2 +- arch/x86/kernel/apic/x2apic_uv_x.c | 2 +- arch/x86/kernel/cpu/common.c | 2 +- arch/x86/kernel/cpu/hypervisor.c | 3 ++- arch/x86/kernel/cpu/intel.c | 2 +- arch/x86/kernel/cpu/match.c | 2 +- arch/x86/kernel/cpu/mshyperv.c | 3 ++- arch/x86/kernel/cpu/mtrr/cleanup.c | 1 - arch/x86/kernel/cpu/mtrr/generic.c | 2 +- arch/x86/kernel/cpu/perfctr-watchdog.c | 2 +- arch/x86/kernel/cpu/vmware.c | 3 ++- arch/x86/kernel/crash.c | 2 +- arch/x86/kernel/dumpstack_32.c | 2 +- arch/x86/kernel/dumpstack_64.c | 2 +- arch/x86/kernel/hw_breakpoint.c | 3 ++- arch/x86/kernel/i386_ksyms_32.c | 3 ++- arch/x86/kernel/i8253.c | 2 +- arch/x86/kernel/io_delay.c | 2 +- arch/x86/kernel/irq_32.c | 1 - arch/x86/kernel/irq_64.c | 1 - arch/x86/kernel/kdebugfs.c | 2 +- arch/x86/kernel/kvm.c | 2 +- arch/x86/kernel/mpparse.c | 1 - arch/x86/kernel/paravirt-spinlocks.c | 2 +- arch/x86/kernel/paravirt.c | 3 ++- arch/x86/kernel/pci-swiotlb.c | 2 +- arch/x86/kernel/pmem.c | 2 +- arch/x86/kernel/process.c | 3 ++- arch/x86/kernel/process_32.c | 2 +- arch/x86/kernel/process_64.c | 2 +- arch/x86/kernel/reboot.c | 2 +- arch/x86/kernel/setup.c | 2 +- arch/x86/kernel/smpboot.c | 2 +- arch/x86/kernel/stacktrace.c | 2 +- arch/x86/kernel/traps.c | 2 +- arch/x86/kernel/tsc.c | 2 +- arch/x86/kernel/x8664_ksyms_64.c | 2 +- arch/x86/kernel/x86_init.c | 2 +- 50 files changed, 50 insertions(+), 49 deletions(-)
arch/x86/include/asm/topology.h +1 -0
@@ -36,6 +36,7 @@#include <linux/cpumask.h> #include <asm/mpspec.h> +#include <asm/percpu.h> /* Mappings between logical cpu number and node number */ DECLARE_EARLY_PER_CPU (int, x86_cpu_to_node_map);
arch/x86/kernel/acpi/boot.c +1 -1
@@ -28,7 +28,7 @@#include <linux/acpi_pmtmr.h> #include <linux/efi.h> #include <linux/cpumask.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/dmi.h> #include <linux/irq.h> #include <linux/slab.h>
arch/x86/kernel/acpi/cstate.c +1 -1
@@ -5,7 +5,7 @@*/ #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/init.h> #include <linux/acpi.h> #include <linux/cpu.h>
arch/x86/kernel/amd_gart_64.c +0 -1
@@ -20,7 +20,6 @@#include <linux/string.h> #include <linux/spinlock.h> #include <linux/pci.h> -#include <linux/module.h> #include <linux/topology.h> #include <linux/interrupt.h> #include <linux/bitmap.h>
arch/x86/kernel/amd_nb.c +1 -1
@@ -9,7 +9,7 @@#include <linux/slab.h> #include <linux/init.h> #include <linux/errno.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/spinlock.h> #include <asm/amd_nb.h>
arch/x86/kernel/apic/apic.c +1 -1
@@ -23,7 +23,7 @@#include <linux/bootmem.h> #include <linux/ftrace.h> #include <linux/ioport.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/syscore_ops.h> #include <linux/delay.h> #include <linux/timex.h>
arch/x86/kernel/apic/apic_flat_64.c +1 -1
@@ -15,7 +15,7 @@#include <linux/kernel.h> #include <linux/ctype.h> #include <linux/hardirq.h> -#include <linux/module.h> +#include <linux/export.h> #include <asm/smp.h> #include <asm/apic.h> #include <asm/ipi.h>
arch/x86/kernel/apic/apic_noop.c +0 -1
@@ -11,7 +11,6 @@#include <linux/threads.h> #include <linux/cpumask.h> -#include <linux/module.h> #include <linux/string.h> #include <linux/kernel.h> #include <linux/ctype.h>
arch/x86/kernel/apic/hw_nmi.c +1 -1
@@ -16,7 +16,7 @@#include <linux/notifier.h> #include <linux/kprobes.h> #include <linux/nmi.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/delay.h> #ifdef CONFIG_HARDLOCKUP_DETECTOR
arch/x86/kernel/apic/io_apic.c +1 -1
@@ -39,7 +39,7 @@#include <linux/mc146818rtc.h> #include <linux/compiler.h> #include <linux/acpi.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/syscore_ops.h> #include <linux/freezer.h> #include <linux/kthread.h>
arch/x86/kernel/apic/ipi.c +0 -1
@@ -8,7 +8,6 @@#include <linux/mc146818rtc.h> #include <linux/cache.h> #include <linux/cpu.h> -#include <linux/module.h> #include <asm/smp.h> #include <asm/mtrr.h>
arch/x86/kernel/apic/probe_32.c +1 -1
@@ -8,7 +8,7 @@*/ #include <linux/threads.h> #include <linux/cpumask.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/string.h> #include <linux/kernel.h> #include <linux/ctype.h>
arch/x86/kernel/apic/probe_64.c +1 -1
@@ -11,7 +11,7 @@#include <linux/threads.h> #include <linux/cpumask.h> #include <linux/string.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/kernel.h> #include <linux/ctype.h> #include <linux/init.h>
arch/x86/kernel/apic/x2apic_uv_x.c +1 -1
@@ -12,7 +12,7 @@#include <linux/proc_fs.h> #include <linux/threads.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/string.h> #include <linux/ctype.h> #include <linux/sched.h>
arch/x86/kernel/cpu/common.c +1 -1
@@ -2,7 +2,7 @@#include <linux/linkage.h> #include <linux/bitops.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/percpu.h> #include <linux/string.h> #include <linux/ctype.h>
arch/x86/kernel/cpu/hypervisor.c +2 -1
@@ -21,7 +21,8 @@* */ -#include <linux/module.h> +#include <linux/init.h> +#include <linux/export.h> #include <asm/processor.h> #include <asm/hypervisor.h>
arch/x86/kernel/cpu/intel.c +1 -1
@@ -5,7 +5,7 @@#include <linux/smp.h> #include <linux/sched.h> #include <linux/thread_info.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/uaccess.h> #include <asm/cpufeature.h>
arch/x86/kernel/cpu/match.c +1 -1
@@ -1,7 +1,7 @@#include <asm/cpu_device_id.h> #include <asm/cpufeature.h> #include <linux/cpu.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/slab.h> /**
arch/x86/kernel/cpu/mshyperv.c +2 -1
@@ -13,7 +13,8 @@#include <linux/types.h> #include <linux/time.h> #include <linux/clocksource.h> -#include <linux/module.h> +#include <linux/init.h> +#include <linux/export.h> #include <linux/hardirq.h> #include <linux/efi.h> #include <linux/interrupt.h>
arch/x86/kernel/cpu/mtrr/cleanup.c +0 -1
@@ -17,7 +17,6 @@* License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/module.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/smp.h>
arch/x86/kernel/cpu/mtrr/generic.c +1 -1
@@ -4,7 +4,7 @@*/ #define DEBUG -#include <linux/module.h> +#include <linux/export.h> #include <linux/init.h> #include <linux/io.h> #include <linux/mm.h>
arch/x86/kernel/cpu/perfctr-watchdog.c +1 -1
@@ -12,7 +12,7 @@*/ #include <linux/percpu.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/kernel.h> #include <linux/bitops.h> #include <linux/smp.h>
arch/x86/kernel/cpu/vmware.c +2 -1
@@ -22,7 +22,8 @@*/ #include <linux/dmi.h> -#include <linux/module.h> +#include <linux/init.h> +#include <linux/export.h> #include <asm/div64.h> #include <asm/x86_init.h> #include <asm/hypervisor.h>
arch/x86/kernel/crash.c +1 -1
@@ -20,7 +20,7 @@#include <linux/delay.h> #include <linux/elf.h> #include <linux/elfcore.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/slab.h> #include <linux/vmalloc.h>
arch/x86/kernel/dumpstack_32.c +1 -1
@@ -7,7 +7,7 @@#include <linux/uaccess.h> #include <linux/hardirq.h> #include <linux/kdebug.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/ptrace.h> #include <linux/kexec.h> #include <linux/sysfs.h>
arch/x86/kernel/dumpstack_64.c +1 -1
@@ -7,7 +7,7 @@#include <linux/uaccess.h> #include <linux/hardirq.h> #include <linux/kdebug.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/ptrace.h> #include <linux/kexec.h> #include <linux/sysfs.h>
arch/x86/kernel/hw_breakpoint.c +2 -1
@@ -36,13 +36,14 @@#include <linux/percpu.h> #include <linux/kdebug.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/sched.h> #include <linux/smp.h> #include <asm/hw_breakpoint.h> #include <asm/processor.h> #include <asm/debugreg.h> +#include <asm/user.h> /* Per cpu debug control register value */ DEFINE_PER_CPU(unsigned long, cpu_dr7);
arch/x86/kernel/i386_ksyms_32.c +2 -1
@@ -1,4 +1,5 @@ -#include <linux/module.h> +#include <linux/export.h> +#include <linux/spinlock_types.h> #include <asm/checksum.h> #include <asm/pgtable.h>
arch/x86/kernel/i8253.c +1 -1
@@ -3,7 +3,7 @@* */ #include <linux/clockchips.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/timex.h> #include <linux/i8253.h>
arch/x86/kernel/io_delay.c +1 -1
@@ -6,7 +6,7 @@* outb_p/inb_p API uses. */ #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/delay.h> #include <linux/init.h> #include <linux/dmi.h>
arch/x86/kernel/irq_32.c +0 -1
@@ -8,7 +8,6 @@* io_apic.c.) */ -#include <linux/module.h> #include <linux/seq_file.h> #include <linux/interrupt.h> #include <linux/kernel_stat.h>
arch/x86/kernel/irq_64.c +0 -1
@@ -11,7 +11,6 @@#include <linux/kernel_stat.h> #include <linux/interrupt.h> #include <linux/seq_file.h> -#include <linux/module.h> #include <linux/delay.h> #include <linux/ftrace.h> #include <linux/uaccess.h>
arch/x86/kernel/kdebugfs.c +1 -1
@@ -8,7 +8,7 @@*/ #include <linux/debugfs.h> #include <linux/uaccess.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/slab.h> #include <linux/init.h> #include <linux/stat.h>
arch/x86/kernel/kvm.c +1 -1
@@ -21,7 +21,7 @@*/ #include <linux/context_tracking.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/kernel.h> #include <linux/kvm_para.h> #include <linux/cpu.h>
arch/x86/kernel/mpparse.c +0 -1
@@ -16,7 +16,6 @@#include <linux/mc146818rtc.h> #include <linux/bitops.h> #include <linux/acpi.h> -#include <linux/module.h> #include <linux/smp.h> #include <linux/pci.h>
arch/x86/kernel/paravirt-spinlocks.c +1 -1
@@ -3,7 +3,7 @@* compiled in a FTRACE-compatible way. */ #include <linux/spinlock.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/jump_label.h> #include <asm/paravirt.h>
arch/x86/kernel/paravirt.c +2 -1
@@ -19,7 +19,8 @@*/ #include <linux/errno.h> -#include <linux/module.h> +#include <linux/init.h> +#include <linux/export.h> #include <linux/efi.h> #include <linux/bcd.h> #include <linux/highmem.h>
arch/x86/kernel/pci-swiotlb.c +1 -1
@@ -2,7 +2,7 @@#include <linux/pci.h> #include <linux/cache.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/swiotlb.h> #include <linux/bootmem.h> #include <linux/dma-mapping.h>
arch/x86/kernel/pmem.c +1 -1
@@ -3,7 +3,7 @@* Copyright (c) 2015, Intel Corporation. */ #include <linux/platform_device.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/ioport.h> static int found (u64 start,u64 end,void *data)
arch/x86/kernel/process.c +2 -1
@@ -7,7 +7,8 @@#include <linux/prctl.h> #include <linux/slab.h> #include <linux/sched.h> -#include <linux/module.h> +#include <linux/init.h> +#include <linux/export.h> #include <linux/pm.h> #include <linux/tick.h> #include <linux/random.h>
arch/x86/kernel/process_32.c +1 -1
@@ -25,7 +25,7 @@#include <linux/delay.h> #include <linux/reboot.h> #include <linux/mc146818rtc.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/kallsyms.h> #include <linux/ptrace.h> #include <linux/personality.h>
arch/x86/kernel/process_64.c +1 -1
@@ -26,7 +26,7 @@#include <linux/user.h> #include <linux/interrupt.h> #include <linux/delay.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/ptrace.h> #include <linux/notifier.h> #include <linux/kprobes.h>
arch/x86/kernel/reboot.c +1 -1
@@ -1,6 +1,6 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt -#include <linux/module.h> +#include <linux/export.h> #include <linux/reboot.h> #include <linux/init.h> #include <linux/pm.h>
arch/x86/kernel/setup.c +1 -1
@@ -36,7 +36,7 @@#include <linux/console.h> #include <linux/root_dev.h> #include <linux/highmem.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/efi.h> #include <linux/init.h> #include <linux/edd.h>
arch/x86/kernel/smpboot.c +1 -1
@@ -43,7 +43,7 @@#include <linux/init.h> #include <linux/smp.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/sched.h> #include <linux/percpu.h> #include <linux/bootmem.h>
arch/x86/kernel/stacktrace.c +1 -1
@@ -5,7 +5,7 @@*/ #include <linux/sched.h> #include <linux/stacktrace.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/uaccess.h> #include <asm/stacktrace.h>
arch/x86/kernel/traps.c +1 -1
@@ -21,7 +21,7 @@#include <linux/kdebug.h> #include <linux/kgdb.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/ptrace.h> #include <linux/uprobes.h> #include <linux/string.h>
arch/x86/kernel/tsc.c +1 -1
@@ -3,7 +3,7 @@#include <linux/kernel.h> #include <linux/sched.h> #include <linux/init.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/timer.h> #include <linux/acpi_pmtmr.h> #include <linux/cpufreq.h>
arch/x86/kernel/x8664_ksyms_64.c +1 -1
@@ -1,7 +1,7 @@/* Exports for assembly files. All C exports should go in the respective C files. */ -#include <linux/module.h> +#include <linux/export.h> #include <linux/smp.h> #include <net/checksum.h>
arch/x86/kernel/x86_init.c +1 -1
@@ -5,7 +5,7 @@*/ #include <linux/init.h> #include <linux/ioport.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/pci.h> #include <asm/bios_ebda.h>
PATCH 4/8 x86: lib: audit and remove any unnecessary uses of module.h
In reply to Paul GortmakerHistorically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. The advantage in doing so is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.
Since module.h was the source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each obj-y/bool instance for the presence of either and replace as needed. Build testing revealed a couple implicit header usage issues that were fixed.
--- arch/x86/lib/cache-smp.c | 2 +- arch/x86/lib/cpu.c | 3 ++- arch/x86/lib/csum-partial_64.c | 2 +- arch/x86/lib/csum-wrappers_64.c | 2 +- arch/x86/lib/delay.c | 2 +- arch/x86/lib/memcpy_32.c | 2 +- arch/x86/lib/mmx_32.c | 2 +- arch/x86/lib/msr-reg-export.c | 2 +- arch/x86/lib/msr-smp.c | 2 +- arch/x86/lib/msr.c | 3 ++- arch/x86/lib/string_32.c | 2 +- arch/x86/lib/usercopy.c | 2 +- arch/x86/lib/usercopy_32.c | 2 +- arch/x86/lib/usercopy_64.c | 2 +- 14 files changed, 16 insertions(+), 14 deletions(-)
arch/x86/lib/cache-smp.c +1 -1
@@ -1,5 +1,5 @@#include <linux/smp.h> -#include <linux/module.h> +#include <linux/export.h> static void __wbinvd (void *dummy) {
arch/x86/lib/cpu.c +2 -1
@@ -1,4 +1,5 @@ -#include <linux/module.h> +#include <linux/types.h> +#include <linux/export.h> unsigned int x86_family (unsigned int sig) {
arch/x86/lib/csum-partial_64.c +1 -1
@@ -6,7 +6,7 @@*/ #include <linux/compiler.h> -#include <linux/module.h> +#include <linux/export.h> #include <asm/checksum.h> static inline unsigned short from32to16 (unsigned a)
arch/x86/lib/csum-wrappers_64.c +1 -1
@@ -5,7 +5,7 @@* Wrappers of assembly checksum functions for x86-64. */ #include <asm/checksum.h> -#include <linux/module.h> +#include <linux/export.h> #include <asm/smap.h> /**
arch/x86/lib/delay.c +1 -1
@@ -11,7 +11,7 @@* we have to worry about. */ -#include <linux/module.h> +#include <linux/export.h> #include <linux/sched.h> #include <linux/timex.h> #include <linux/preempt.h>
arch/x86/lib/memcpy_32.c +1 -1
@@ -1,5 +1,5 @@#include <linux/string.h> -#include <linux/module.h> +#include <linux/export.h> #undef memcpy#undef memset
arch/x86/lib/mmx_32.c +1 -1
@@ -18,7 +18,7 @@*/ #include <linux/hardirq.h> #include <linux/string.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/sched.h> #include <linux/types.h>
arch/x86/lib/msr-reg-export.c +1 -1
@@ -1,4 +1,4 @@ -#include <linux/module.h> +#include <linux/export.h> #include <asm/msr.h> EXPORT_SYMBOL (rdmsr_safe_regs);
arch/x86/lib/msr-smp.c +1 -1
@@ -1,4 +1,4 @@ -#include <linux/module.h> +#include <linux/export.h> #include <linux/preempt.h> #include <linux/smp.h> #include <asm/msr.h>
arch/x86/lib/msr.c +2 -1
@@ -1,4 +1,5 @@ -#include <linux/module.h> +#include <linux/export.h> +#include <linux/percpu.h> #include <linux/preempt.h> #include <asm/msr.h> #define CREATE_TRACE_POINTS
arch/x86/lib/string_32.c +1 -1
@@ -11,7 +11,7 @@*/ #include <linux/string.h> -#include <linux/module.h> +#include <linux/export.h> #ifdef __HAVE_ARCH_STRCPYchar *strcpy (char *dest,const char *src)
arch/x86/lib/usercopy.c +1 -1
@@ -5,7 +5,7 @@*/ #include <linux/highmem.h> -#include <linux/module.h> +#include <linux/export.h> #include <asm/word-at-a-time.h> #include <linux/sched.h>
arch/x86/lib/usercopy_32.c +1 -1
@@ -8,7 +8,7 @@#include <linux/mm.h> #include <linux/highmem.h> #include <linux/blkdev.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/backing-dev.h> #include <linux/interrupt.h> #include <asm/uaccess.h>
arch/x86/lib/usercopy_64.c +1 -1
@@ -5,7 +5,7 @@* Copyright 1997 Linus Torvalds * Copyright 2002 Andi Kleen <[email protected]> */ -#include <linux/module.h> +#include <linux/export.h> #include <asm/uaccess.h> /*
Signature · 1 line
2.8.4
tip-bot for Paul Gortmaker
merge bot[tip:x86/headers] x86/lib: Audit and remove any unnecessary uses of module.h
x86/lib: Audit and remove any unnecessary uses of module.h
Commit-ID: e683014c2113d374b8716a7c938803c2f578efd5 Gitweb: http://git.kernel.org/tip/e683014c2113d374b8716a7c938803c2f578efd5 Author: Paul Gortmaker <[email protected]> AuthorDate: Wed, 13 Jul 2016 20:18:57 -0400 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 14 Jul 2016 15:06:58 +0200
x86/lib: Audit and remove any unnecessary uses of module.h
Historically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. The advantage in doing so is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.
Since module.h was the source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each obj-y/bool instance for the presence of either and replace as needed. Build testing revealed a couple implicit header usage issues that were fixed.
--- arch/x86/lib/cache-smp.c | 2 +- arch/x86/lib/cpu.c | 3 ++- arch/x86/lib/csum-partial_64.c | 2 +- arch/x86/lib/csum-wrappers_64.c | 2 +- arch/x86/lib/delay.c | 2 +- arch/x86/lib/memcpy_32.c | 2 +- arch/x86/lib/mmx_32.c | 2 +- arch/x86/lib/msr-reg-export.c | 2 +- arch/x86/lib/msr-smp.c | 2 +- arch/x86/lib/msr.c | 3 ++- arch/x86/lib/string_32.c | 2 +- arch/x86/lib/usercopy.c | 2 +- arch/x86/lib/usercopy_32.c | 2 +- arch/x86/lib/usercopy_64.c | 2 +- 14 files changed, 16 insertions(+), 14 deletions(-)
arch/x86/lib/cache-smp.c +1 -1
@@ -1,5 +1,5 @@#include <linux/smp.h> -#include <linux/module.h> +#include <linux/export.h> static void __wbinvd (void *dummy) {
arch/x86/lib/cpu.c +2 -1
@@ -1,4 +1,5 @@ -#include <linux/module.h> +#include <linux/types.h> +#include <linux/export.h> unsigned int x86_family (unsigned int sig) {
arch/x86/lib/csum-partial_64.c +1 -1
@@ -6,7 +6,7 @@*/ #include <linux/compiler.h> -#include <linux/module.h> +#include <linux/export.h> #include <asm/checksum.h> static inline unsigned short from32to16 (unsigned a)
arch/x86/lib/csum-wrappers_64.c +1 -1
@@ -5,7 +5,7 @@* Wrappers of assembly checksum functions for x86-64. */ #include <asm/checksum.h> -#include <linux/module.h> +#include <linux/export.h> #include <asm/smap.h> /**
arch/x86/lib/delay.c +1 -1
@@ -11,7 +11,7 @@* we have to worry about. */ -#include <linux/module.h> +#include <linux/export.h> #include <linux/sched.h> #include <linux/timex.h> #include <linux/preempt.h>
arch/x86/lib/memcpy_32.c +1 -1
@@ -1,5 +1,5 @@#include <linux/string.h> -#include <linux/module.h> +#include <linux/export.h> #undef memcpy#undef memset
arch/x86/lib/mmx_32.c +1 -1
@@ -18,7 +18,7 @@*/ #include <linux/hardirq.h> #include <linux/string.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/sched.h> #include <linux/types.h>
arch/x86/lib/msr-reg-export.c +1 -1
@@ -1,4 +1,4 @@ -#include <linux/module.h> +#include <linux/export.h> #include <asm/msr.h> EXPORT_SYMBOL (rdmsr_safe_regs);
arch/x86/lib/msr-smp.c +1 -1
@@ -1,4 +1,4 @@ -#include <linux/module.h> +#include <linux/export.h> #include <linux/preempt.h> #include <linux/smp.h> #include <asm/msr.h>
arch/x86/lib/msr.c +2 -1
@@ -1,4 +1,5 @@ -#include <linux/module.h> +#include <linux/export.h> +#include <linux/percpu.h> #include <linux/preempt.h> #include <asm/msr.h> #define CREATE_TRACE_POINTS
arch/x86/lib/string_32.c +1 -1
@@ -11,7 +11,7 @@*/ #include <linux/string.h> -#include <linux/module.h> +#include <linux/export.h> #ifdef __HAVE_ARCH_STRCPYchar *strcpy (char *dest,const char *src)
arch/x86/lib/usercopy.c +1 -1
@@ -5,7 +5,7 @@*/ #include <linux/highmem.h> -#include <linux/module.h> +#include <linux/export.h> #include <asm/word-at-a-time.h> #include <linux/sched.h>
arch/x86/lib/usercopy_32.c +1 -1
@@ -8,7 +8,7 @@#include <linux/mm.h> #include <linux/highmem.h> #include <linux/blkdev.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/backing-dev.h> #include <linux/interrupt.h> #include <asm/uaccess.h>
arch/x86/lib/usercopy_64.c +1 -1
@@ -5,7 +5,7 @@* Copyright 1997 Linus Torvalds * Copyright 2002 Andi Kleen <[email protected]> */ -#include <linux/module.h> +#include <linux/export.h> #include <asm/uaccess.h> /*
PATCH 5/8 x86: platform: audit and remove any unnecessary uses of module.h
In reply to Paul GortmakerHistorically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. The advantage in doing so is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.
Since module.h was the source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each obj-y/bool instance for the presence of either and replace as needed.
One module.h was converted to moduleparam.h since the file had multiple module_param() in it, and another file had an instance of MODULE_DEVICE_TABLE deleted, since that is a no-op when builtin.
Finally, the 32 bit build coverage of olpc_ofw revealed a couple implicit includes, which were pretty self evident to fix based on what gcc was complaining about.
--- arch/x86/platform/ce4100/ce4100.c | 2 +- arch/x86/platform/efi/efi_64.c | 2 +- arch/x86/platform/intel-mid/intel-mid.c | 2 +- arch/x86/platform/intel-mid/pwr.c | 4 +--- arch/x86/platform/intel-mid/sfi.c | 2 +- arch/x86/platform/olpc/olpc.c | 2 +- arch/x86/platform/olpc/olpc_ofw.c | 5 ++++- arch/x86/platform/ts5500/ts5500.c | 2 +- arch/x86/platform/uv/uv_irq.c | 2 +- arch/x86/platform/uv/uv_nmi.c | 2 +- 10 files changed, 13 insertions(+), 12 deletions(-)
arch/x86/platform/ce4100/ce4100.c +1 -1
@@ -11,7 +11,7 @@#include <linux/init.h> #include <linux/kernel.h> #include <linux/irq.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/reboot.h> #include <linux/serial_reg.h> #include <linux/serial_8250.h>
arch/x86/platform/efi/efi_64.c +1 -1
@@ -24,7 +24,7 @@#include <linux/spinlock.h> #include <linux/bootmem.h> #include <linux/ioport.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/mc146818rtc.h> #include <linux/efi.h> #include <linux/uaccess.h>
arch/x86/platform/intel-mid/intel-mid.c +1 -1
@@ -20,7 +20,7 @@#include <linux/scatterlist.h> #include <linux/sfi.h> #include <linux/irq.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/notifier.h> #include <asm/setup.h>
arch/x86/platform/intel-mid/pwr.c +1 -3
@@ -21,10 +21,9 @@#include <linux/delay.h> #include <linux/errno.h> -#include <linux/init.h> #include <linux/interrupt.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/mutex.h> #include <linux/pci.h>
@@ -407,7 +406,6 @@ static const struct pci_device_id mid_pwr_pci_ids[] = { { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_TANGIER), (kernel_ulong_t)&mid_info }, {} }; -MODULE_DEVICE_TABLE (pci, mid_pwr_pci_ids);static struct pci_driver mid_pwr_pci_driver = { .name = "intel_mid_pwr",
arch/x86/platform/intel-mid/sfi.c +1 -1
@@ -24,7 +24,7 @@#include <linux/input.h> #include <linux/platform_device.h> #include <linux/irq.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/notifier.h> #include <linux/mmc/core.h> #include <linux/mmc/card.h>
arch/x86/platform/olpc/olpc.c +1 -1
@@ -12,7 +12,7 @@#include <linux/kernel.h> #include <linux/init.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/delay.h> #include <linux/io.h> #include <linux/string.h>
arch/x86/platform/olpc/olpc_ofw.c +4 -1
@@ -1,9 +1,12 @@#include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> +#include <linux/spinlock_types.h> #include <linux/init.h> #include <asm/page.h> #include <asm/setup.h> #include <asm/io.h> +#include <asm/cpufeature.h> +#include <asm/special_insns.h> #include <asm/pgtable.h> #include <asm/olpc_ofw.h>
arch/x86/platform/ts5500/ts5500.c +1 -1
@@ -23,7 +23,7 @@#include <linux/io.h> #include <linux/kernel.h> #include <linux/leds.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_data/gpio-ts5500.h> #include <linux/platform_data/max197.h> #include <linux/platform_device.h>
arch/x86/platform/uv/uv_irq.c +1 -1
@@ -8,7 +8,7 @@* Copyright (C) 2008 Silicon Graphics, Inc. All rights reserved. */ -#include <linux/module.h> +#include <linux/export.h> #include <linux/rbtree.h> #include <linux/slab.h> #include <linux/irq.h>
arch/x86/platform/uv/uv_nmi.c +1 -1
@@ -24,7 +24,7 @@#include <linux/kdb.h> #include <linux/kexec.h> #include <linux/kgdb.h> -#include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/nmi.h> #include <linux/sched.h> #include <linux/slab.h>
Signature · 1 line
2.8.4
tip-bot for Paul Gortmaker
merge bot[tip:x86/headers] x86/platform: Audit and remove any unnecessary uses of module.h
x86/platform: Audit and remove any unnecessary uses of module.h
Commit-ID: cc3ae7b0af27118994c1e491382b253be3b762bf Gitweb: http://git.kernel.org/tip/cc3ae7b0af27118994c1e491382b253be3b762bf Author: Paul Gortmaker <[email protected]> AuthorDate: Wed, 13 Jul 2016 20:18:58 -0400 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 14 Jul 2016 15:06:59 +0200
x86/platform: Audit and remove any unnecessary uses of module.h
Historically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. The advantage in doing so is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.
Since module.h was the source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each obj-y/bool instance for the presence of either and replace as needed.
One module.h was converted to moduleparam.h since the file had multiple module_param() in it, and another file had an instance of MODULE_DEVICE_TABLE deleted, since that is a no-op when builtin.
Finally, the 32 bit build coverage of olpc_ofw revealed a couple implicit includes, which were pretty self evident to fix based on what gcc was complaining about.
--- arch/x86/platform/ce4100/ce4100.c | 2 +- arch/x86/platform/efi/efi_64.c | 2 +- arch/x86/platform/intel-mid/intel-mid.c | 2 +- arch/x86/platform/intel-mid/pwr.c | 4 +--- arch/x86/platform/intel-mid/sfi.c | 2 +- arch/x86/platform/olpc/olpc.c | 2 +- arch/x86/platform/olpc/olpc_ofw.c | 5 ++++- arch/x86/platform/ts5500/ts5500.c | 2 +- arch/x86/platform/uv/uv_irq.c | 2 +- arch/x86/platform/uv/uv_nmi.c | 2 +- 10 files changed, 13 insertions(+), 12 deletions(-)
arch/x86/platform/ce4100/ce4100.c +1 -1
@@ -11,7 +11,7 @@#include <linux/init.h> #include <linux/kernel.h> #include <linux/irq.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/reboot.h> #include <linux/serial_reg.h> #include <linux/serial_8250.h>
arch/x86/platform/efi/efi_64.c +1 -1
@@ -24,7 +24,7 @@#include <linux/spinlock.h> #include <linux/bootmem.h> #include <linux/ioport.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/efi.h> #include <linux/uaccess.h> #include <linux/io.h>
arch/x86/platform/intel-mid/intel-mid.c +1 -1
@@ -20,7 +20,7 @@#include <linux/scatterlist.h> #include <linux/sfi.h> #include <linux/irq.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/notifier.h> #include <asm/setup.h>
arch/x86/platform/intel-mid/pwr.c +1 -3
@@ -21,10 +21,9 @@#include <linux/delay.h> #include <linux/errno.h> -#include <linux/init.h> #include <linux/interrupt.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/mutex.h> #include <linux/pci.h>
@@ -407,7 +406,6 @@ static const struct pci_device_id mid_pwr_pci_ids[] = { { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_TANGIER), (kernel_ulong_t)&mid_info }, {} }; -MODULE_DEVICE_TABLE (pci, mid_pwr_pci_ids);static struct pci_driver mid_pwr_pci_driver = { .name = "intel_mid_pwr",
arch/x86/platform/intel-mid/sfi.c +1 -1
@@ -24,7 +24,7 @@#include <linux/input.h> #include <linux/platform_device.h> #include <linux/irq.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/notifier.h> #include <linux/mmc/core.h> #include <linux/mmc/card.h>
arch/x86/platform/olpc/olpc.c +1 -1
@@ -12,7 +12,7 @@#include <linux/kernel.h> #include <linux/init.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/delay.h> #include <linux/io.h> #include <linux/string.h>
arch/x86/platform/olpc/olpc_ofw.c +4 -1
@@ -1,9 +1,12 @@#include <linux/kernel.h> -#include <linux/module.h> +#include <linux/export.h> +#include <linux/spinlock_types.h> #include <linux/init.h> #include <asm/page.h> #include <asm/setup.h> #include <asm/io.h> +#include <asm/cpufeature.h> +#include <asm/special_insns.h> #include <asm/pgtable.h> #include <asm/olpc_ofw.h>
arch/x86/platform/ts5500/ts5500.c +1 -1
@@ -23,7 +23,7 @@#include <linux/io.h> #include <linux/kernel.h> #include <linux/leds.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_data/gpio-ts5500.h> #include <linux/platform_data/max197.h> #include <linux/platform_device.h>
arch/x86/platform/uv/uv_irq.c +1 -1
@@ -8,7 +8,7 @@* Copyright (C) 2008 Silicon Graphics, Inc. All rights reserved. */ -#include <linux/module.h> +#include <linux/export.h> #include <linux/rbtree.h> #include <linux/slab.h> #include <linux/irq.h>
arch/x86/platform/uv/uv_nmi.c +1 -1
@@ -24,7 +24,7 @@#include <linux/kdb.h> #include <linux/kexec.h> #include <linux/kgdb.h> -#include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/nmi.h> #include <linux/sched.h> #include <linux/slab.h>
PATCH 6/8 x86: xen: audit and remove any unnecessary uses of module.h
In reply to Paul GortmakerHistorically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. The advantage in doing so is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.
Since module.h was the source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each obj-y/bool instance for the presence of either and replace as needed.
--- arch/x86/xen/debugfs.c | 1 - arch/x86/xen/enlighten.c | 2 +- arch/x86/xen/mmu.c | 3 ++- arch/x86/xen/p2m.c | 2 +- arch/x86/xen/platform-pci-unplug.c | 2 +- arch/x86/xen/setup.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
arch/x86/xen/debugfs.c +0 -1
@@ -1,7 +1,6 @@#include <linux/init.h> #include <linux/debugfs.h> #include <linux/slab.h> -#include <linux/module.h> #include "debugfs.h"
arch/x86/xen/enlighten.c +1 -1
@@ -23,7 +23,7 @@#include <linux/sched.h> #include <linux/kprobes.h> #include <linux/bootmem.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/mm.h> #include <linux/page-flags.h> #include <linux/highmem.h>
arch/x86/xen/mmu.c +2 -1
@@ -43,7 +43,8 @@#include <linux/debugfs.h> #include <linux/bug.h> #include <linux/vmalloc.h> -#include <linux/module.h> +#include <linux/export.h> +#include <linux/init.h> #include <linux/gfp.h> #include <linux/memblock.h> #include <linux/seq_file.h>
arch/x86/xen/p2m.c +1 -1
@@ -60,7 +60,7 @@*/ #include <linux/init.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/list.h> #include <linux/hash.h> #include <linux/sched.h>
arch/x86/xen/platform-pci-unplug.c +1 -1
@@ -21,7 +21,7 @@#include <linux/init.h> #include <linux/io.h> -#include <linux/module.h> +#include <linux/export.h> #include <xen/platform_pci.h> #include "xen-ops.h"
arch/x86/xen/setup.c +1 -1
@@ -4,7 +4,7 @@* Jeremy Fitzhardinge <[email protected]>, XenSource Inc, 2007 */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/sched.h> #include <linux/mm.h> #include <linux/pm.h>
Signature · 7 lines
2.8.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 6/8] x86: xen: audit and remove any unnecessary uses of module.h
Quoted 15 lines · Paul Gortmaker
Historically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via
EXPORT_SYMBOLand friends. That changed when we forked out support for the latter into theexport.hfile.This means we should be able to reduce the usage of
module.hin code that is obj-yMakefileor boolKconfig. The advantage in doing so is thatmodule.hitself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.Since
module.hwas the source forinit.h(for__init) and forexport.h(forEXPORT_SYMBOL) we consider each obj-y/bool instance for the presence of either and replace as needed.
Quoted 9 lines
Cc Boris Ostrovsky <[email protected]>Cc David Vrabel <[email protected]>Cc Juergen Gross <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Ingo Molnar <[email protected]>Cc "H. Peter Anvin" <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH 6/8] x86: xen: audit and remove any unnecessary uses of module.h
In reply to Paul GortmakerQuoted 15 lines · Paul Gortmaker
Historically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via
EXPORT_SYMBOLand friends. That changed when we forked out support for the latter into theexport.hfile.This means we should be able to reduce the usage of
module.hin code that is obj-yMakefileor boolKconfig. The advantage in doing so is thatmodule.hitself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.Since
module.hwas the source forinit.h(for__init) and forexport.h(forEXPORT_SYMBOL) we consider each obj-y/bool instance for the presence of either and replace as needed.
Quoted 9 lines
Cc Boris Ostrovsky <[email protected]>Cc David Vrabel <[email protected]>Cc Juergen Gross <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Ingo Molnar <[email protected]>Cc "H. Peter Anvin" <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>
Juergen
tip-bot for Paul Gortmaker
merge bot[tip:x86/headers] x86/xen: Audit and remove any unnecessary uses of module.h
In reply to Paul Gortmakerx86/xen: Audit and remove any unnecessary uses of module.h
Commit-ID: 7a2463dcacee3f2f36c78418c201756372eeea6b Gitweb: http://git.kernel.org/tip/7a2463dcacee3f2f36c78418c201756372eeea6b Author: Paul Gortmaker <[email protected]> AuthorDate: Wed, 13 Jul 2016 20:18:59 -0400 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 14 Jul 2016 15:06:59 +0200
x86/xen: Audit and remove any unnecessary uses of module.h
Historically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. The advantage in doing so is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.
Since module.h was the source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each obj-y/bool instance for the presence of either and replace as needed.
--- arch/x86/xen/debugfs.c | 1 - arch/x86/xen/enlighten.c | 2 +- arch/x86/xen/mmu.c | 3 ++- arch/x86/xen/p2m.c | 2 +- arch/x86/xen/platform-pci-unplug.c | 2 +- arch/x86/xen/setup.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
arch/x86/xen/debugfs.c +0 -1
@@ -1,7 +1,6 @@#include <linux/init.h> #include <linux/debugfs.h> #include <linux/slab.h> -#include <linux/module.h> #include "debugfs.h"
arch/x86/xen/enlighten.c +1 -1
@@ -23,7 +23,7 @@#include <linux/sched.h> #include <linux/kprobes.h> #include <linux/bootmem.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/mm.h> #include <linux/page-flags.h> #include <linux/highmem.h>
arch/x86/xen/mmu.c +2 -1
@@ -43,7 +43,8 @@#include <linux/debugfs.h> #include <linux/bug.h> #include <linux/vmalloc.h> -#include <linux/module.h> +#include <linux/export.h> +#include <linux/init.h> #include <linux/gfp.h> #include <linux/memblock.h> #include <linux/seq_file.h>
arch/x86/xen/p2m.c +1 -1
@@ -60,7 +60,7 @@*/ #include <linux/init.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/list.h> #include <linux/hash.h> #include <linux/sched.h>
arch/x86/xen/platform-pci-unplug.c +1 -1
@@ -21,7 +21,7 @@#include <linux/init.h> #include <linux/io.h> -#include <linux/module.h> +#include <linux/export.h> #include <xen/platform_pci.h> #include "xen-ops.h"
arch/x86/xen/setup.c +1 -1
@@ -4,7 +4,7 @@* Jeremy Fitzhardinge <[email protected]>, XenSource Inc, 2007 */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/sched.h> #include <linux/mm.h> #include <linux/pm.h>
PATCH 7/8 x86: kvm: audit and remove any unnecessary uses of module.h
In reply to Paul GortmakerHistorically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. In the case of kvm where it is modular, we can extend that to also include files that are building basic support functionality but not related to loading or registering the final module; such files also have no need whatsoever for module.h
The advantage in removing such instances is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.
Since module.h was the source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each instance for the presence of either and replace as needed.
Several instances got replaced with moduleparam.h since that was really all that was required for those particular files.
--- arch/x86/kvm/cpuid.c | 2 +- arch/x86/kvm/emulate.c | 1 - arch/x86/kvm/iommu.c | 2 +- arch/x86/kvm/irq.c | 2 +- arch/x86/kvm/lapic.c | 2 +- arch/x86/kvm/mmu.c | 3 ++- arch/x86/kvm/x86.c | 3 ++- 7 files changed, 8 insertions(+), 7 deletions(-)
arch/x86/kvm/cpuid.c +1 -1
@@ -13,7 +13,7 @@*/ #include <linux/kvm_host.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/vmalloc.h> #include <linux/uaccess.h> #include <asm/fpu/internal.h> /* For use_eager_fpu. Ugh! */
arch/x86/kvm/emulate.c +0 -1
@@ -22,7 +22,6 @@#include <linux/kvm_host.h> #include "kvm_cache_regs.h" -#include <linux/module.h> #include <asm/kvm_emulate.h> #include <linux/stringify.h> #include <asm/debugreg.h>
arch/x86/kvm/iommu.c +1 -1
@@ -25,7 +25,7 @@#include <linux/list.h> #include <linux/kvm_host.h> -#include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/pci.h> #include <linux/stat.h> #include <linux/iommu.h>
arch/x86/kvm/irq.c +1 -1
@@ -20,7 +20,7 @@* */ -#include <linux/module.h> +#include <linux/export.h> #include <linux/kvm_host.h> #include "irq.h"
arch/x86/kvm/lapic.c +1 -1
@@ -25,7 +25,7 @@#include <linux/smp.h> #include <linux/hrtimer.h> #include <linux/io.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/math64.h> #include <linux/slab.h> #include <asm/processor.h>
arch/x86/kvm/mmu.c +2 -1
@@ -29,7 +29,8 @@#include <linux/string.h> #include <linux/mm.h> #include <linux/highmem.h> -#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/export.h> #include <linux/swap.h> #include <linux/hugetlb.h> #include <linux/compiler.h>
arch/x86/kvm/x86.c +2 -1
@@ -36,7 +36,8 @@#include <linux/kvm.h> #include <linux/fs.h> #include <linux/vmalloc.h> -#include <linux/module.h> +#include <linux/export.h> +#include <linux/moduleparam.h> #include <linux/mman.h> #include <linux/highmem.h> #include <linux/iommu.h>
Signature · 1 line
2.8.4
Re: [PATCH 7/8] x86: kvm: audit and remove any unnecessary uses of module.h
Quoted 7 lines · Paul Gortmaker
This means we should be able to reduce the usage of
module.hin code that is obj-yMakefileor boolKconfig. In the case of kvm where it is modular, we can extend that to also include files that are building basic support functionality but not related to loading or registering the final module; such files also have no need whatsoever formodule.h
tip-bot for Paul Gortmaker
merge bot[tip:x86/headers] x86/kvm: Audit and remove any unnecessary uses of module.h
In reply to Paul Gortmakerx86/kvm: Audit and remove any unnecessary uses of module.h
Commit-ID: 1767e931e3c3024b1f0d115082179191f5d652c2 Gitweb: http://git.kernel.org/tip/1767e931e3c3024b1f0d115082179191f5d652c2 Author: Paul Gortmaker <[email protected]> AuthorDate: Wed, 13 Jul 2016 20:19:00 -0400 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 14 Jul 2016 15:07:00 +0200
x86/kvm: Audit and remove any unnecessary uses of module.h
Historically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. In the case of kvm where it is modular, we can extend that to also include files that are building basic support functionality but not related to loading or registering the final module; such files also have no need whatsoever for module.h
The advantage in removing such instances is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.
Since module.h was the source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each instance for the presence of either and replace as needed.
Several instances got replaced with moduleparam.h since that was really all that was required for those particular files.
--- arch/x86/kvm/cpuid.c | 2 +- arch/x86/kvm/emulate.c | 1 - arch/x86/kvm/iommu.c | 2 +- arch/x86/kvm/irq.c | 2 +- arch/x86/kvm/lapic.c | 2 +- arch/x86/kvm/mmu.c | 3 ++- arch/x86/kvm/x86.c | 3 ++- 7 files changed, 8 insertions(+), 7 deletions(-)
arch/x86/kvm/cpuid.c +1 -1
@@ -13,7 +13,7 @@*/ #include <linux/kvm_host.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/vmalloc.h> #include <linux/uaccess.h> #include <asm/fpu/internal.h> /* For use_eager_fpu. Ugh! */
arch/x86/kvm/emulate.c +0 -1
@@ -22,7 +22,6 @@#include <linux/kvm_host.h> #include "kvm_cache_regs.h" -#include <linux/module.h> #include <asm/kvm_emulate.h> #include <linux/stringify.h> #include <asm/debugreg.h>
arch/x86/kvm/iommu.c +1 -1
@@ -25,7 +25,7 @@#include <linux/list.h> #include <linux/kvm_host.h> -#include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/pci.h> #include <linux/stat.h> #include <linux/dmar.h>
arch/x86/kvm/irq.c +1 -1
@@ -20,7 +20,7 @@* */ -#include <linux/module.h> +#include <linux/export.h> #include <linux/kvm_host.h> #include "irq.h"
arch/x86/kvm/lapic.c +1 -1
@@ -25,7 +25,7 @@#include <linux/smp.h> #include <linux/hrtimer.h> #include <linux/io.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/math64.h> #include <linux/slab.h> #include <asm/processor.h>
arch/x86/kvm/mmu.c +2 -1
@@ -29,7 +29,8 @@#include <linux/string.h> #include <linux/mm.h> #include <linux/highmem.h> -#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/export.h> #include <linux/swap.h> #include <linux/hugetlb.h> #include <linux/compiler.h>
arch/x86/kvm/x86.c +2 -1
@@ -36,7 +36,8 @@#include <linux/kvm.h> #include <linux/fs.h> #include <linux/vmalloc.h> -#include <linux/module.h> +#include <linux/export.h> +#include <linux/moduleparam.h> #include <linux/mman.h> #include <linux/highmem.h> #include <linux/iommu.h>
PATCH 8/8 x86: audit and remove any remaining unnecessary uses of module.h
In reply to Paul GortmakerHistorically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. In the case of some of these which are modular, we can extend that to also include files that are building basic support functionality but not related to loading or registering the final module; such files also have no need whatsoever for module.h
The advantage in removing such instances is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.
Since module.h was the source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each instance for the presence of either and replace as needed.
In the case of crypto/glue_helper.c we delete a redundant instance of MODULE_LICENSE in order to delete module.h -- the license info is already present at the top of the file.
The uncore change warrants a mention too; it is uncore.c that uses module.h and not uncore.h; hence the relocation done there.
--- arch/x86/crypto/glue_helper.c | 4 +--- arch/x86/events/amd/ibs.c | 3 ++- arch/x86/events/amd/iommu.c | 2 +- arch/x86/events/core.c | 3 ++- arch/x86/events/intel/uncore.c | 2 ++ arch/x86/events/intel/uncore.h | 1 - arch/x86/include/asm/livepatch.h | 1 - arch/x86/kernel/cpu/mtrr/if.c | 1 - arch/x86/kernel/cpu/mtrr/main.c | 2 +- arch/x86/pci/xen.c | 2 +- arch/x86/um/delay.c | 2 +- 11 files changed, 11 insertions(+), 12 deletions(-)
arch/x86/crypto/glue_helper.c +1 -3
@@ -25,7 +25,7 @@* */ -#include <linux/module.h> +#include <linux/export.h> #include <crypto/b128ops.h> #include <crypto/lrw.h> #include <crypto/xts.h>
@@ -397,5 +397,3 @@ void glue_xts_crypt_128bit_one(void *ctx, u128 *dst, const u128 *src, le128 *iv,u128_xor (dst, dst, (u128 *)&ivblk); }EXPORT_SYMBOL_GPL (glue_xts_crypt_128bit_one); - -MODULE_LICENSE ("GPL" );
arch/x86/events/amd/ibs.c +2 -1
@@ -7,7 +7,8 @@*/ #include <linux/perf_event.h> -#include <linux/module.h> +#include <linux/init.h> +#include <linux/export.h> #include <linux/pci.h> #include <linux/ptrace.h> #include <linux/syscore_ops.h>
arch/x86/events/amd/iommu.c +1 -1
@@ -12,7 +12,7 @@*/ #include <linux/perf_event.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/cpumask.h> #include <linux/slab.h>
arch/x86/events/core.c +2 -1
@@ -17,7 +17,8 @@#include <linux/notifier.h> #include <linux/hardirq.h> #include <linux/kprobes.h> -#include <linux/module.h> +#include <linux/export.h> +#include <linux/init.h> #include <linux/kdebug.h> #include <linux/sched.h> #include <linux/uaccess.h>
arch/x86/events/intel/uncore.c +2 -0
@@ -1,3 +1,5 @@ +#include <linux/module.h> +#include <asm/cpu_device_id.h> #include <asm/intel-family.h> #include "uncore.h"
arch/x86/events/intel/uncore.h +0 -1
@@ -1,4 +1,3 @@ -#include <linux/module.h> #include <linux/slab.h> #include <linux/pci.h> #include <asm/apicdef.h>
arch/x86/include/asm/livepatch.h +0 -1
@@ -22,7 +22,6 @@#define _ASM_X86_LIVEPATCH_H#include <asm/setup.h> -#include <linux/module.h> #include <linux/ftrace.h> static inline int klp_check_compiler_support (void )
arch/x86/kernel/cpu/mtrr/if.c +0 -1
@@ -2,7 +2,6 @@#include <linux/seq_file.h> #include <linux/uaccess.h> #include <linux/proc_fs.h> -#include <linux/module.h> #include <linux/ctype.h> #include <linux/string.h> #include <linux/slab.h>
arch/x86/kernel/cpu/mtrr/main.c +1 -1
@@ -38,7 +38,7 @@#include <linux/stop_machine.h> #include <linux/kvm_para.h> #include <linux/uaccess.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/mutex.h> #include <linux/init.h> #include <linux/sort.h>
arch/x86/pci/xen.c +1 -1
@@ -9,7 +9,7 @@* Konrad Rzeszutek Wilk <[email protected]> * Stefano Stabellini <[email protected]> */ -#include <linux/module.h> +#include <linux/export.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/acpi.h>
arch/x86/um/delay.c +1 -1
@@ -7,7 +7,7 @@* published by the Free Software Foundation. */ -#include <linux/module.h> +#include <linux/export.h> #include <linux/kernel.h> #include <linux/delay.h> #include <asm/param.h>
Signature · 1 line
2.8.4
tip-bot for Paul Gortmaker
merge bot[tip:x86/headers] x86: Audit and remove any remaining unnecessary uses of module.h
x86: Audit and remove any remaining unnecessary uses of module.h
Commit-ID: eb008eb6f8b689853d6e9f4ae3ff56ea734e4319 Gitweb: http://git.kernel.org/tip/eb008eb6f8b689853d6e9f4ae3ff56ea734e4319 Author: Paul Gortmaker <[email protected]> AuthorDate: Wed, 13 Jul 2016 20:19:01 -0400 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 14 Jul 2016 15:07:00 +0200
x86: Audit and remove any remaining unnecessary uses of module.h
Historically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. In the case of some of these which are modular, we can extend that to also include files that are building basic support functionality but not related to loading or registering the final module; such files also have no need whatsoever for module.h
The advantage in removing such instances is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using.
Since module.h was the source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each instance for the presence of either and replace as needed.
In the case of crypto/glue_helper.c we delete a redundant instance of MODULE_LICENSE in order to delete module.h -- the license info is already present at the top of the file.
The uncore change warrants a mention too; it is uncore.c that uses module.h and not uncore.h; hence the relocation done there.
--- arch/x86/crypto/glue_helper.c | 4 +--- arch/x86/events/amd/ibs.c | 3 ++- arch/x86/events/amd/iommu.c | 2 +- arch/x86/events/core.c | 3 ++- arch/x86/events/intel/uncore.c | 2 ++ arch/x86/events/intel/uncore.h | 1 - arch/x86/include/asm/livepatch.h | 1 - arch/x86/kernel/cpu/mtrr/if.c | 1 - arch/x86/kernel/cpu/mtrr/main.c | 2 +- arch/x86/pci/xen.c | 2 +- arch/x86/um/delay.c | 2 +- 11 files changed, 11 insertions(+), 12 deletions(-)
arch/x86/crypto/glue_helper.c +1 -3
@@ -25,7 +25,7 @@* */ -#include <linux/module.h> +#include <linux/export.h> #include <crypto/b128ops.h> #include <crypto/lrw.h> #include <crypto/xts.h>
@@ -397,5 +397,3 @@ void glue_xts_crypt_128bit_one(void *ctx, u128 *dst, const u128 *src, le128 *iv,u128_xor (dst, dst, (u128 *)&ivblk); }EXPORT_SYMBOL_GPL (glue_xts_crypt_128bit_one); - -MODULE_LICENSE ("GPL" );
arch/x86/events/amd/ibs.c +2 -1
@@ -7,7 +7,8 @@*/ #include <linux/perf_event.h> -#include <linux/module.h> +#include <linux/init.h> +#include <linux/export.h> #include <linux/pci.h> #include <linux/ptrace.h> #include <linux/syscore_ops.h>
arch/x86/events/amd/iommu.c +1 -1
@@ -12,7 +12,7 @@*/ #include <linux/perf_event.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/cpumask.h> #include <linux/slab.h>
arch/x86/events/core.c +2 -1
@@ -17,7 +17,8 @@#include <linux/notifier.h> #include <linux/hardirq.h> #include <linux/kprobes.h> -#include <linux/module.h> +#include <linux/export.h> +#include <linux/init.h> #include <linux/kdebug.h> #include <linux/sched.h> #include <linux/uaccess.h>
arch/x86/events/intel/uncore.c +2 -0
@@ -1,3 +1,5 @@ +#include <linux/module.h> +#include <asm/cpu_device_id.h> #include "uncore.h"
arch/x86/events/intel/uncore.h +0 -1
@@ -1,4 +1,3 @@ -#include <linux/module.h> #include <linux/slab.h> #include <linux/pci.h> #include <asm/apicdef.h>
arch/x86/include/asm/livepatch.h +0 -1
@@ -22,7 +22,6 @@#define _ASM_X86_LIVEPATCH_H#include <asm/setup.h> -#include <linux/module.h> #include <linux/ftrace.h> static inline int klp_check_compiler_support (void )
arch/x86/kernel/cpu/mtrr/if.c +0 -1
@@ -2,7 +2,6 @@#include <linux/seq_file.h> #include <linux/uaccess.h> #include <linux/proc_fs.h> -#include <linux/module.h> #include <linux/ctype.h> #include <linux/string.h> #include <linux/slab.h>
arch/x86/kernel/cpu/mtrr/main.c +1 -1
@@ -38,7 +38,7 @@#include <linux/stop_machine.h> #include <linux/kvm_para.h> #include <linux/uaccess.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/mutex.h> #include <linux/init.h> #include <linux/sort.h>
arch/x86/pci/xen.c +1 -1
@@ -9,7 +9,7 @@* Konrad Rzeszutek Wilk <[email protected]> * Stefano Stabellini <[email protected]> */ -#include <linux/module.h> +#include <linux/export.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/acpi.h>
arch/x86/um/delay.c +1 -1
@@ -7,7 +7,7 @@* published by the Free Software Foundation. */ -#include <linux/module.h> +#include <linux/export.h> #include <linux/kernel.h> #include <linux/delay.h> #include <asm/param.h>
Quoted 3 lines · Paul Gortmaker
To that end, I have done allmodconfig, allyesconfig and allnoconfig for both 32 bit and 64 bit x86 with these changes on the linux-next from today, which presumably has an up to date copy of tip in it.
It does, still I get this on allnoconfig with your patches applied:
arch/x86/kernel/setup_percpu.c: In function ‘setup_percpu_segment’:arch/x86/kernel/setup_percpu.c:159:2: error: implicit declaration of function ‘pack_descriptor’ [-Werror=implicit-function-declaration]
pack_descriptor(&gdt, per_cpu_offset(cpu), 0xFFFFF,
^arch/x86/kernel/setup_percpu.c:162:2: error: implicit declaration of function ‘write_gdt_entry’ [-Werror=implicit-function-declaration]
write_gdt_entry(get_cpu_gdt_table(cpu),
^arch/x86/kernel/setup_percpu.c:162:18: error: implicit declaration of function ‘get_cpu_gdt_table’ [-Werror=implicit-function-declaration]
write_gdt_entry(get_cpu_gdt_table(cpu),
I'll continue testing with the setup_percpu.c change left out.
Thanks,
Ingo
Quoted 8 lines · [Re: [PATCH 0/8] x86: audit and remove needless module.h includes] On…
Quoted 3 lines · Paul Gortmaker
To that end, I have done allmodconfig, allyesconfig and allnoconfig for both 32 bit and 64 bit x86 with these changes on the linux-next from today, which presumably has an up to date copy of tip in it.
It does, still I get this on allnoconfig with your patches applied:
Took me a while to figure out why I didn't see this; I was able to finally reproduce it on x86-32 with allnoconfig but CONFIG_SMP=y.
Quoted 13 lines
arch/x86/kernel/setup_percpu.c: In function ‘setup_percpu_segment’:arch/x86/kernel/setup_percpu.c:159:2: error: implicit declaration of function ‘pack_descriptor’ [-Werror=implicit-function-declaration]
pack_descriptor(&gdt,per_cpu_offset(cpu),0xFFFFF,
^arch/x86/kernel/setup_percpu.c:162:2: error: implicit declaration of function ‘write_gdt_entry’ [-Werror=implicit-function-declaration]
write_gdt_entry(get_cpu_gdt_table(cpu),
^arch/x86/kernel/setup_percpu.c:162:18: error: implicit declaration of function ‘get_cpu_gdt_table’ [-Werror=implicit-function-declaration]
write_gdt_entry(get_cpu_gdt_table(cpu),
All three of these guys live in asm/desc.h and adding that to the top of arch/x86/kernel/setup_percpu.c asm include list seems to fix the reproducer I now have here.
Quoted 2 lines
I'll continue testing with the
setup_percpu.cchange left out.
Let me know if you want a resend or if you want to just add the asm/desc.h locally or ...
Paul.
--
Quoted 4 lines
Thanks,
Ingo
Quoted 4 lines · Paul Gortmaker
Quoted 1 line
I'll continue testing with the
setup_percpu.cchange left out.Let me know if you want a resend or if you want to just add the
asm/desc.hlocally or ...
So I tried the asm/desc.h but saw other build failures - for now gave up. Can we do this in a separate patch?
Thanks,
Ingo
Quoted 10 lines · [Re: [PATCH 0/8] x86: audit and remove needless module.h includes] On…
Quoted 4 lines · Paul Gortmaker
Quoted 1 line
I'll continue testing with the
setup_percpu.cchange left out.Let me know if you want a resend or if you want to just add the
asm/desc.hlocally or ...So I tried the
asm/desc.hbut saw other build failures - for now gave up. Can we do this in a separate patch?
Yes of course. In the meantime I'll investigate further and add more configs to my testing. Is there a list of the configs used for sanity testing tip somewhere?
Thanks,
Paul.
--
Quoted 4 lines
Thanks,
Ingo
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 10 lines · [Re: [PATCH 0/8] x86: audit and remove needless module.h includes] On…
Quoted 4 lines · Paul Gortmaker
Quoted 1 line
I'll continue testing with the
setup_percpu.cchange left out.Let me know if you want a resend or if you want to just add the
asm/desc.hlocally or ...So I tried the
asm/desc.hbut saw other build failures - for now gave up. Can we do this in a separate patch?
Yes of course. In the meantime I'll investigate further and add more configs to my testing. Is there a list of the configs used for sanity testing tip somewhere?
Thanks,
Paul.
--
Quoted 4 lines
Thanks,
Ingo
Quoted 10 lines · Paul Gortmaker
Quoted 8 lines · [Re: [PATCH 0/8] x86: audit and remove needless module.h includes] On…
Quoted 4 lines · Paul Gortmaker
Quoted 1 line
I'll continue testing with the
setup_percpu.cchange left out.Let me know if you want a resend or if you want to just add the
asm/desc.hlocally or ...
Quoted 6 lines
Quoted 2 lines
So I tried the
asm/desc.hbut saw other build failures - for now gave up. Can we do this in a separate patch?Yes of course. In the meantime I'll investigate further and add more configs to my testing. Is there a list of the configs used for sanity testing tip somewhere?
No need for you to complicate your testing (unless you have enough hardware resources for that) - I can deal with the occasional build failure. Since I eventually create and boot randconfigs there's no fixed set of configs. :-/
That I enabled SMP on the "allnoconfig" (and forgot about it!) has to do with the fact that even my allnoconfigs are typically bootable (on one of my test systems) so there's a handful of pre-baked configs that always get enabled.
But other than those small perturbations I do similar testing to what you did:
all{no|def|mod|yes}config on x86-{32|64}, plus randconfigs.
Thanks,
Ingo
Quoted 10 lines · Paul Gortmaker
Quoted 8 lines · [Re: [PATCH 0/8] x86: audit and remove needless module.h includes] On…
Quoted 4 lines · Paul Gortmaker
Quoted 1 line
I'll continue testing with the
setup_percpu.cchange left out.Let me know if you want a resend or if you want to just add the
asm/desc.hlocally or ...
Quoted 6 lines
Quoted 2 lines
So I tried the
asm/desc.hbut saw other build failures - for now gave up. Can we do this in a separate patch?Yes of course. In the meantime I'll investigate further and add more configs to my testing. Is there a list of the configs used for sanity testing tip somewhere?
No need for you to complicate your testing (unless you have enough hardware resources for that) - I can deal with the occasional build failure. Since I eventually create and boot randconfigs there's no fixed set of configs. :-/
That I enabled SMP on the "allnoconfig" (and forgot about it!) has to do with the fact that even my allnoconfigs are typically bootable (on one of my test systems) so there's a handful of pre-baked configs that always get enabled.
But other than those small perturbations I do similar testing to what you did:
all{no|def|mod|yes}config on x86-{32|64}, plus randconfigs.
Thanks,
Ingo
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 4 lines · Paul Gortmaker
Quoted 1 line
I'll continue testing with the
setup_percpu.cchange left out.Let me know if you want a resend or if you want to just add the
asm/desc.hlocally or ...
So I tried the asm/desc.h but saw other build failures - for now gave up. Can we do this in a separate patch?
Thanks,
Ingo
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 8 lines · [Re: [PATCH 0/8] x86: audit and remove needless module.h includes] On…
Quoted 3 lines · Paul Gortmaker
To that end, I have done allmodconfig, allyesconfig and allnoconfig for both 32 bit and 64 bit x86 with these changes on the linux-next from today, which presumably has an up to date copy of tip in it.
It does, still I get this on allnoconfig with your patches applied:
Took me a while to figure out why I didn't see this; I was able to finally reproduce it on x86-32 with allnoconfig but CONFIG_SMP=y.
Quoted 13 lines
arch/x86/kernel/setup_percpu.c: In function ‘setup_percpu_segment’:arch/x86/kernel/setup_percpu.c:159:2: error: implicit declaration of function ‘pack_descriptor’ [-Werror=implicit-function-declaration]
pack_descriptor(&gdt,per_cpu_offset(cpu),0xFFFFF,
^arch/x86/kernel/setup_percpu.c:162:2: error: implicit declaration of function ‘write_gdt_entry’ [-Werror=implicit-function-declaration]
write_gdt_entry(get_cpu_gdt_table(cpu),
^arch/x86/kernel/setup_percpu.c:162:18: error: implicit declaration of function ‘get_cpu_gdt_table’ [-Werror=implicit-function-declaration]
write_gdt_entry(get_cpu_gdt_table(cpu),
All three of these guys live in asm/desc.h and adding that to the top of arch/x86/kernel/setup_percpu.c asm include list seems to fix the reproducer I now have here.
Quoted 2 lines
I'll continue testing with the
setup_percpu.cchange left out.
Let me know if you want a resend or if you want to just add the asm/desc.h locally or ...
Paul.
--
Quoted 4 lines
Thanks,
Ingo
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 3 lines · Paul Gortmaker
To that end, I have done allmodconfig, allyesconfig and allnoconfig for both 32 bit and 64 bit x86 with these changes on the linux-next from today, which presumably has an up to date copy of tip in it.
It does, still I get this on allnoconfig with your patches applied:
arch/x86/kernel/setup_percpu.c: In function ‘setup_percpu_segment’:arch/x86/kernel/setup_percpu.c:159:2: error: implicit declaration of function ‘pack_descriptor’ [-Werror=implicit-function-declaration]
pack_descriptor(&gdt, per_cpu_offset(cpu), 0xFFFFF,
^arch/x86/kernel/setup_percpu.c:162:2: error: implicit declaration of function ‘write_gdt_entry’ [-Werror=implicit-function-declaration]
write_gdt_entry(get_cpu_gdt_table(cpu),
^arch/x86/kernel/setup_percpu.c:162:18: error: implicit declaration of function ‘get_cpu_gdt_table’ [-Werror=implicit-function-declaration]
write_gdt_entry(get_cpu_gdt_table(cpu),
I'll continue testing with the setup_percpu.c change left out.
Thanks,
Ingo
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel