[PATCH] x86: don't warn about duplicate initializion of stack sizes

From: Arnd Bergmann
Date: Wed Jun 15 2016 - 03:10:07 EST


arch/x86/include/asm/page_64_types.h:18:21: error: initialized field overwritten [-Werror=override-init]
#define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER)
^
arch/x86/kernel/cpu/common.c:1304:26: note: in expansion of macro âDEBUG_STKSZâ
[DEBUG_STACK - 1] = DEBUG_STKSZ
^
arch/x86/include/asm/page_64_types.h:18:21: note: (near initialization for âexception_stack_sizes[2]â)
#define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER)
^
arch/x86/kernel/cpu/common.c:1304:26: note: in expansion of macro âDEBUG_STKSZâ
[DEBUG_STACK - 1] = DEBUG_STKSZ

Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 5ba74f280448..ebc909203a38 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1268,6 +1268,7 @@ EXPORT_PER_CPU_SYMBOL(__preempt_count);
* limit), all of them are 4K, except the debug stack which
* is 8K.
*/
+#pragma GCC diagnostic ignored "-Woverride-init"
static const unsigned int exception_stack_sizes[N_EXCEPTION_STACKS] = {
[0 ... N_EXCEPTION_STACKS - 1] = EXCEPTION_STKSZ,
[DEBUG_STACK - 1] = DEBUG_STKSZ