kvm: x86: Mark __kvm_vcpu_halt() as static
PATCH 1/1 kvm: x86: Mark __kvm_vcpu_halt() as static
Kernel test robot throws below warning ->
Quoted 2 lines
Quoted 2 lines
arch/x86/kvm/x86.c:7979:5: warning: no previous prototype for '__kvm_vcpu_halt' [-Wmissing-prototypes]
7979 | int __kvm_vcpu_halt(struct kvm_vcpu *vcpu, int state, int
reason)
| ^~~~~~~~~~~~~~~
Marking __kvm_vcpu_halt() as static as it is used inside this file.
--- arch/x86/kvm/x86.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kvm/x86.c +2 -1
@@ -109,6 +109,7 @@static void __kvm_set_rflags (struct kvm_vcpu *vcpu,unsigned long rflags);static void store_regs (struct kvm_vcpu *vcpu);static int sync_regs (struct kvm_vcpu *vcpu); +static int __kvm_vcpu_halt (struct kvm_vcpu *vcpu,int state,int reason);struct kvm_x86_ops kvm_x86_ops__read_mostly ;EXPORT_SYMBOL_GPL (kvm_x86_ops);
@@ -7976,7 +7977,7 @@ void kvm_arch_exit(void)kmem_cache_destroy (x86_fpu_cache); } -int __kvm_vcpu_halt (struct kvm_vcpu *vcpu,int state,int reason) +static int __kvm_vcpu_halt (struct kvm_vcpu *vcpu,int state,int reason) { ++vcpu->stat.halt_exits;if (lapic_in_kernel (vcpu)) {
Signature · 1 line
1.9.1
Sean Christopherson
maintainerQuoted 9 lines · Souptick Joarder
Kernel test robot throws below warning ->
Quoted 2 lines
Quoted 2 lines
arch/x86/kvm/x86.c:7979:5: warning: no previous prototype for '__kvm_vcpu_halt' [-Wmissing-prototypes]7979 | int __kvm_vcpu_halt(struct
kvm_vcpu*vcpu, int state, int
reason)| ^~~~~~~~~~~~~~~Marking
__kvm_vcpu_halt()as static as it is used inside this file.
Paolo beat you to the punch, commit 872f36eb0b0f ("KVM: x86: __kvm_vcpu_halt can be static").
Quoted 11 lines
Reported-by kernel test robot <[email protected]>Signed-off-by Souptick Joarder <[email protected]>--- arch/x86/kvm/x86.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/x86/kvm/x86.c +0
-0
arch/x86/kvm/x86.c line 112
Quoted 4 lines
arch/x86/kvm/x86.c +1
-0@@ -109,6 +109,7 @@static void __kvm_set_rflags (struct kvm_vcpu *vcpu,unsigned long rflags);static void store_regs (struct kvm_vcpu *vcpu);static int sync_regs (struct kvm_vcpu *vcpu); +static int __kvm_vcpu_halt (struct kvm_vcpu *vcpu,int state,int reason);
FWIW, this forward declaration is unnecessary.
Quoted 14 lines
arch/x86/kvm/x86.c +1
-1struct kvm_x86_ops kvm_x86_ops__read_mostly ;EXPORT_SYMBOL_GPL (kvm_x86_ops);@@ -7976,7 +7977,7 @@ void kvm_arch_exit(void)kmem_cache_destroy (x86_fpu_cache); } -int __kvm_vcpu_halt (struct kvm_vcpu *vcpu,int state,int reason) +static int __kvm_vcpu_halt (struct kvm_vcpu *vcpu,int state,int reason) { ++vcpu->stat.halt_exits;if (lapic_in_kernel (vcpu)) {Signature · 1 line
1.9.1