x86/cpu: Move prototype for get_umwait_control_msr() to global location
PATCH 1/1 x86/cpu: Move prototype for get_umwait_control_msr() to global location
.. in order to fix a -Wmissing-prototype warning.
No functional change.
Signed-off-by Benjamin Thiel <[email protected]>
--- arch/x86/include/asm/mwait.h | 2 ++ arch/x86/kernel/cpu/umwait.c | 1 + arch/x86/kvm/vmx/vmx.c | 1 + arch/x86/kvm/vmx/vmx.h | 2 -- 4 files changed, 4 insertions(+), 2 deletions(-)
arch/x86/include/asm/mwait.h +2 -0
@@ -23,6 +23,8 @@#define MWAITX_MAX_LOOPS ((u32)-1)#define MWAITX_DISABLE_CSTATES 0xf0 +extern u32 get_umwait_control_msr (void ); +static inline void __monitor (const void *eax,unsigned long ecx,unsigned long edx) {
arch/x86/kernel/cpu/umwait.c +1 -0
@@ -4,6 +4,7 @@#include <linux/cpu.h> #include <asm/msr.h> +#include <asm/mwait.h> #define UMWAIT_C02_ENABLE 0
arch/x86/kvm/vmx/vmx.c +1 -0
@@ -44,6 +44,7 @@#include <asm/spec-ctrl.h> #include <asm/virtext.h> #include <asm/vmx.h> +#include <asm/mwait.h> #include "capabilities.h" #include "cpuid.h"
arch/x86/kvm/vmx/vmx.h +0 -2
@@ -14,8 +14,6 @@extern const u32 vmx_msr_index[];extern u64 host_efer; -extern u32 get_umwait_control_msr (void ); -#define MSR_TYPE_R 1#define MSR_TYPE_W 2#define MSR_TYPE_RW 3
Signature · 1 line
2.17.1
Quoted 17 lines · Benjamin Thiel
.. in order to fix a -Wmissing-prototype warning.
No functional change.
Signed-off-by Benjamin Thiel <[email protected]>--- arch/x86/include/asm/mwait.h | 2 ++ arch/x86/kernel/cpu/umwait.c | 1 + arch/x86/kvm/vmx/vmx.c | 1 + arch/x86/kvm/vmx/vmx.h | 2 -- 4 files changed, 4 insertions(+), 2 deletions(-)arch/x86/include/asm/mwait.h +0
-0
arch/x86/include/asm/mwait.h line 26
Quoted 4 lines
arch/x86/include/asm/mwait.h +1
-0@@ -23,6 +23,8 @@#define MWAITX_MAX_LOOPS ((u32)-1)#define MWAITX_DISABLE_CSTATES 0xf0 +extern u32 get_umwait_control_msr (void );
Nit: extern isn't needed on function declarations. It shouldn't have been added in the VMX code, but I'm guessing the author saw the externs on the vmx_msr_index and host_efer variables and followed suite. Since there is no existing precedent in mwait.h, now would be a good time to drop it.
Quoted 21 lines
arch/x86/include/asm/mwait.h +1
-0+static inline void __monitor (const void *eax,unsigned long ecx,unsigned long edx) {arch/x86/kernel/cpu/umwait.c +1
-0@@ -4,6 +4,7 @@#include <linux/cpu.h> #include <asm/msr.h> +#include <asm/mwait.h> #define UMWAIT_C02_ENABLE 0arch/x86/kvm/vmx/vmx.c +0
-0
arch/x86/kvm/vmx/vmx.c line 47
Quoted 4 lines
arch/x86/kvm/vmx/vmx.c +1
-0@@ -44,6 +44,7 @@#include <asm/spec-ctrl.h> #include <asm/virtext.h> #include <asm/vmx.h> +#include <asm/mwait.h>
Please maintain the alphabetical ordering of these includes.
Quoted 19 lines
arch/x86/kvm/vmx/vmx.c +0
-0#include "capabilities.h" #include "cpuid.h" arch/x86/kvm/vmx/vmx.h +0
-2@@ -14,8 +14,6 @@extern const u32 vmx_msr_index[];extern u64 host_efer; -extern u32 get_umwait_control_msr (void ); -#define MSR_TYPE_R 1#define MSR_TYPE_W 2#define MSR_TYPE_RW 3Signature · 1 line
2.17.1