1 From 04f4230e2f86a4e961ea5466eda3db8c1762004d Mon Sep 17 00:00:00 2001
2 From: Daniel Sneddon <daniel.sneddon@linux.intel.com>
3 Date: Tue, 9 Apr 2024 16:08:05 -0700
4 Subject: x86/bugs: Fix return type of spectre_bhi_state()
6 From: Daniel Sneddon <daniel.sneddon@linux.intel.com>
8 commit 04f4230e2f86a4e961ea5466eda3db8c1762004d upstream.
10 The definition of spectre_bhi_state() incorrectly returns a const char
11 * const. This causes the a compiler warning when building with W=1:
13 warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
14 2812 | static const char * const spectre_bhi_state(void)
16 Remove the const qualifier from the pointer.
18 Fixes: ec9404e40e8f ("x86/bhi: Add BHI mitigation knob")
19 Reported-by: Sean Christopherson <seanjc@google.com>
20 Signed-off-by: Daniel Sneddon <daniel.sneddon@linux.intel.com>
21 Signed-off-by: Ingo Molnar <mingo@kernel.org>
22 Cc: Linus Torvalds <torvalds@linux-foundation.org>
23 Link: https://lore.kernel.org/r/20240409230806.1545822-1-daniel.sneddon@linux.intel.com
24 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 arch/x86/kernel/cpu/bugs.c | 2 +-
27 1 file changed, 1 insertion(+), 1 deletion(-)
29 --- a/arch/x86/kernel/cpu/bugs.c
30 +++ b/arch/x86/kernel/cpu/bugs.c
31 @@ -2788,7 +2788,7 @@ static char *pbrsb_eibrs_state(void)
35 -static const char * const spectre_bhi_state(void)
36 +static const char *spectre_bhi_state(void)
38 if (!boot_cpu_has_bug(X86_BUG_BHI))
39 return "; BHI: Not affected";