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

From: Paul Gortmaker
Date: Mon Nov 14 2016 - 14:05:10 EST


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.

Reported-by: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
Cc: x86@xxxxxxxxxx
Signed-off-by: Paul Gortmaker <paul.gortmaker@xxxxxxxxxxxxx>
---

[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(-)

diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 8ce03678166e..42c3290e7c79 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -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>
--
2.8.4