Skip to contentSkip to conversation

x86/msr: fix wr/rdmsr_safe_regs_on_cpu prototype

PATCH Applied Arnd Bergmann 2 participants 2 messages Mar 22, 2021 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/msr: fix wr/rdmsr_safe_regs_on_cpu prototype

From: Arnd Bergmann <[email protected]>

gcc-11 warns about mismatched prototypes here:

arch/x86/lib/msr-smp.c:255:51: error: argument 2 of type ‘u32 *’ {aka ‘unsigned int *’} declared as a pointer [-Werror=array-parameter=]
255 | int rdmsr_safe_regs_on_cpu(unsigned int cpu, u32 *regs)
| ~~~~~^~~~
In file included from arch/x86/include/asm/processor.h:22,

                 from arch/x86/include/asm/cpufeature.h:5,
                 from arch/x86/include/asm/thread_info.h:53,
                 from include/linux/thread_info.h:58,
                 from arch/x86/include/asm/preempt.h:7,
                 from include/linux/preempt.h:78,
                 from arch/x86/lib/msr-smp.c:3:

arch/x86/include/asm/msr.h:347:50: note: previously declared as an array ‘u32[8]’ {aka ‘unsigned int[8]’}

---
 arch/x86/lib/msr-smp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/lib/msr-smp.c +2 -2
index 75a0915b0d01..40bbe56bde32 100644
@@ -252,7 +252,7 @@ static void __wrmsr_safe_regs_on_cpu(void *info)
 	rv->err = wrmsr_safe_regs(rv->regs);
 }
 
-int rdmsr_safe_regs_on_cpu(unsigned int cpu, u32 *regs)
+int rdmsr_safe_regs_on_cpu(unsigned int cpu, u32 regs[8])
 {
 	int err;
 	struct msr_regs_info rv;
@@ -265,7 +265,7 @@ int rdmsr_safe_regs_on_cpu(unsigned int cpu, u32 *regs)
 }
 EXPORT_SYMBOL(rdmsr_safe_regs_on_cpu);
 
-int wrmsr_safe_regs_on_cpu(unsigned int cpu, u32 *regs)
+int wrmsr_safe_regs_on_cpu(unsigned int cpu, u32 regs[8])
 {
 	int err;
 	struct msr_regs_info rv;
Signature · 1 line
2.29.2
merge bot Applied
#1 lore raw

[tip: x86/cleanups] x86/msr: Fix wr/rdmsr_safe_regs_on_cpu() prototypes

The following commit has been merged into the x86/cleanups branch of tip:

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID:     396a66aa1172ef2b78c21651f59b40b87b2e5e1e
Gitweb:        https://git.kernel.org/tip/396a66aa1172ef2b78c21651f59b40b87b2e5e1e
Author:        Arnd Bergmann <[email protected]>
AuthorDate:    Mon, 22 Mar 2021 17:45:36 +01:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Mon, 22 Mar 2021 21:37:03 +01:00

x86/msr: Fix wr/rdmsr_safe_regs_on_cpu() prototypes

gcc-11 warns about mismatched prototypes here:

arch/x86/lib/msr-smp.c:255:51: error: argument 2 of type ‘u32 *’ {aka ‘unsigned int *’} declared as a pointer [-Werror=array-parameter=]
255 | int rdmsr_safe_regs_on_cpu(unsigned int cpu, u32 *regs)
| ~~~~~^~~~
arch/x86/include/asm/msr.h:347:50: note: previously declared as an array ‘u32[8]’ {aka ‘unsigned int[8]’}

GCC is right here - fix up the types.

[ mingo: Twiddled the changelog. ]

---
 arch/x86/lib/msr-smp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/lib/msr-smp.c +2 -2
index 75a0915..40bbe56 100644
@@ -252,7 +252,7 @@ static void __wrmsr_safe_regs_on_cpu(void *info)
 	rv->err = wrmsr_safe_regs(rv->regs);
 }
 
-int rdmsr_safe_regs_on_cpu(unsigned int cpu, u32 *regs)
+int rdmsr_safe_regs_on_cpu(unsigned int cpu, u32 regs[8])
 {
 	int err;
 	struct msr_regs_info rv;
@@ -265,7 +265,7 @@ int rdmsr_safe_regs_on_cpu(unsigned int cpu, u32 *regs)
 }
 EXPORT_SYMBOL(rdmsr_safe_regs_on_cpu);
 
-int wrmsr_safe_regs_on_cpu(unsigned int cpu, u32 *regs)
+int wrmsr_safe_regs_on_cpu(unsigned int cpu, u32 regs[8])
 {
 	int err;
 	struct msr_regs_info rv;