]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.15.156/x86-bugs-fix-return-type-of-spectre_bhi_state.patch
drop queue-6.6/arm64-tlb-fix-tlbi-range-operand.patch
[thirdparty/kernel/stable-queue.git] / releases / 5.15.156 / x86-bugs-fix-return-type-of-spectre_bhi_state.patch
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()
5
6 From: Daniel Sneddon <daniel.sneddon@linux.intel.com>
7
8 commit 04f4230e2f86a4e961ea5466eda3db8c1762004d upstream.
9
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:
12
13 warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
14 2812 | static const char * const spectre_bhi_state(void)
15
16 Remove the const qualifier from the pointer.
17
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>
25 ---
26 arch/x86/kernel/cpu/bugs.c | 2 +-
27 1 file changed, 1 insertion(+), 1 deletion(-)
28
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)
32 }
33 }
34
35 -static const char * const spectre_bhi_state(void)
36 +static const char *spectre_bhi_state(void)
37 {
38 if (!boot_cpu_has_bug(X86_BUG_BHI))
39 return "; BHI: Not affected";