[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201026160342.3705327-4-arnd@kernel.org>
Date: Mon, 26 Oct 2020 17:03:31 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>
Cc: Arnd Bergmann <arnd@...db.de>, Mark Rutland <mark.rutland@....com>,
Christoffer Dall <christoffer.dall@...aro.org>,
Marc Zyngier <marc.zyngier@....com>,
Peter Maydell <peter.maydell@...aro.org>,
Will Deacon <will.deacon@....com>,
Dave Martin <Dave.Martin@....com>,
Mark Brown <broonie@...nel.org>,
Dmitry Safonov <0x7f454c46@...il.com>,
James Morse <james.morse@....com>,
Amit Daniel Kachhap <amit.kachhap@....com>,
Gavin Shan <gshan@...hat.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH 4/4] arm64: traps: fix -Woverride-init warnings
From: Arnd Bergmann <arnd@...db.de>
There are many warnings in this file when we re-enable the
Woverride-init flag:
arch/arm64/kernel/traps.c:704:26: warning: initialized field overwritten [-Woverride-init]
704 | [ESR_ELx_EC_UNKNOWN] = "Unknown/Uncategorized",
| ^~~~~~~~~~~~~~~~~~~~~~~
arch/arm64/kernel/traps.c:704:26: note: (near initialization for 'esr_class_str[0]')
arch/arm64/kernel/traps.c:705:22: warning: initialized field overwritten [-Woverride-init]
705 | [ESR_ELx_EC_WFx] = "WFI/WFE",
| ^~~~~~~~~
This is harmless since they are only informational strings,
but it's easy to change the code to ignore missing initialization
and instead warn about possible duplicate initializers.
Fixes: 60a1f02c9e91 ("arm64: decode ESR_ELx.EC when reporting exceptions")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
arch/arm64/kernel/traps.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 8af4e0e85736..d21cb25f9e1f 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -700,7 +700,6 @@ void do_sysinstr(unsigned int esr, struct pt_regs *regs)
NOKPROBE_SYMBOL(do_sysinstr);
static const char *esr_class_str[] = {
- [0 ... ESR_ELx_EC_MAX] = "UNRECOGNIZED EC",
[ESR_ELx_EC_UNKNOWN] = "Unknown/Uncategorized",
[ESR_ELx_EC_WFx] = "WFI/WFE",
[ESR_ELx_EC_CP15_32] = "CP15 MCR/MRC",
@@ -746,7 +745,7 @@ static const char *esr_class_str[] = {
const char *esr_get_class_string(u32 esr)
{
- return esr_class_str[ESR_ELx_EC(esr)];
+ return esr_class_str[ESR_ELx_EC(esr)] ?: "UNRECOGNIZED EC";
}
/*
--
2.27.0
Powered by blists - more mailing lists