Skip to contentSkip to conversation

x86: setup_percpu: remove unnecessary include of module.h, add asm/desc.h

PATCH New Paul Gortmaker 2 participants 2 messages Nov 14, 2016 – Nov 15, 2016 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: setup_percpu: remove unnecessary include of module.h, add asm/desc.h

This was originally a part of commit 186f43608a5c:

("x86/kernel: Audit and remove any unnecessary uses of module.h")

...but without the asm/desc.h addition. As such, Ingo reported a build failure on i386 allnoconfig with SMP=y during his pre-merge
testing. For expediency the chunk was just dropped at that time.

The failure was as follows:

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]

arch/x86/kernel/setup_percpu.c:162:2: error: implicit declaration of function ‘write_gdt_entry’ [-Werror=implicit-function-declaration]

arch/x86/kernel/setup_percpu.c:162:18: error: implicit declaration of function ‘get_cpu_gdt_table’ [-Werror=implicit-function-declaration]

As pack_descriptor, write_gdt_entry and get_cpu_gdt_table all live in the file arch/x86/include/asm/desc.h -- calling that header out explicitly should fix things.

---

[build tested on -next with various configs ; hopefully all sane now.]

 arch/x86/kernel/setup_percpu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/setup_percpu.c +2 -1
index 8ce03678166e..42c3290e7c79 100644
@@ -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>
@@ -12,6 +12,7 @@
 #include <linux/pfn.h>
 #include <asm/sections.h>
 #include <asm/processor.h>
+#include <asm/desc.h>
 #include <asm/setup.h>
 #include <asm/mpspec.h>
 #include <asm/apicdef.h>
Signature · 1 line
2.8.4
#1 lore raw

[tip:x86/headers] x86/percpu: Remove unnecessary include of module.h, add asm/desc.h

x86/percpu: Remove unnecessary include of module.h, add asm/desc.h
Commit-ID:  523d0fb4f05dcefed59c6325acb54adc34ee4c2d
Gitweb:     http://git.kernel.org/tip/523d0fb4f05dcefed59c6325acb54adc34ee4c2d
Author:     Paul Gortmaker <[email protected]>
AuthorDate: Mon, 14 Nov 2016 14:04:43 -0500
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 15 Nov 2016 07:26:37 +0100

x86/percpu: Remove unnecessary include of module.h, add asm/desc.h

This was originally a part of commit 186f43608a5c:

("x86/kernel: Audit and remove any unnecessary uses of module.h")

...but without the asm/desc.h addition. As such, Ingo reported a build failure on i386 allnoconfig with SMP=y during his pre-merge
testing. For expediency the chunk was just dropped at that time.

The failure was as follows:

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] arch/x86/kernel/setup_percpu.c:162:2: error: implicit declaration of function ‘write_gdt_entry’ [-Werror=implicit-function-declaration] arch/x86/kernel/setup_percpu.c:162:18: error: implicit declaration of function ‘get_cpu_gdt_table’ [-Werror=implicit-function-declaration]

As pack_descriptor(), write_gdt_entry() and get_cpu_gdt_table() all live in the file arch/x86/include/asm/desc.h -- calling that header out explicitly should fix things.

---
 arch/x86/kernel/setup_percpu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/setup_percpu.c +2 -1
index 2bbd27f..9820d6d 100644
@@ -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>
@@ -12,6 +12,7 @@
 #include <linux/pfn.h>
 #include <asm/sections.h>
 #include <asm/processor.h>
+#include <asm/desc.h>
 #include <asm/setup.h>
 #include <asm/mpspec.h>
 #include <asm/apicdef.h>