[PATCH] x86/build: provide missing include file for capflags.c

From: Valdis KlÄtnieks
Date: Thu Dec 05 2019 - 23:36:06 EST


When building with C=2, sparse warns about missing definitions:

CHECK arch/x86/kernel/cpu/capflags.c
arch/x86/kernel/cpu/capflags.c:5:12: warning: symbol 'x86_cap_flags' was not declared. Should it be static?
arch/x86/kernel/cpu/capflags.c:261:12: warning: symbol 'x86_bug_flags' was not declared. Should it be static?

Make the script that generates the C file create the needed #include.

Signed-off-by: Valdis Kletnieks <valdis.kletnieks@xxxxxx>

diff --git a/arch/x86/kernel/cpu/mkcapflags.sh b/arch/x86/kernel/cpu/mkcapflags.sh
index aed45b8895d5..f26caa6b6f2d 100644
--- a/arch/x86/kernel/cpu/mkcapflags.sh
+++ b/arch/x86/kernel/cpu/mkcapflags.sh
@@ -56,6 +56,10 @@ trap 'rm "$OUT"' EXIT
echo "#include <asm/cpufeatures.h>"
echo "#endif"
echo ""
+ echo "#ifndef _ASM_X86_CPUFEATURE_H"
+ echo "#include <asm/cpufeature.h>"
+ echo "#endif"
+ echo ""

dump_array "x86_cap_flags" "NCAPINTS*32" "X86_FEATURE_" ""
echo ""