kvm: x86: Fix -Wmissing-prototypes warnings
PATCH v2 1/1 kvm: x86: Fix -Wmissing-prototypes warnings
We get a warning when build kernel W=1:
arch/x86/kvm/../../../virt/kvm/eventfd.c:48:1: warning: no previous prototype for ‘kvm_arch_irqfd_allowed’ [-Wmissing-prototypes]
kvm_arch_irqfd_allowed(struct kvm *kvm, struct kvm_irqfd *args)
^
The reason is kvm_arch_irqfd_allowed() is declared in arch/x86/kvm/irq.h, which is not included by eventfd.c. Considering kvm_arch_irqfd_allowed() is a weakly defined function in eventfd.c, remove the declaration to kvm_host.h can fix this.
---
v2: add comments about the reason.
--- arch/x86/kvm/irq.h | 1 - include/linux/kvm_host.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/irq.h +0 -1
@@ -102,7 +102,6 @@ static inline int irqchip_in_kernel(struct kvm *kvm)return mode !=KVM_IRQCHIP_NONE ; } -bool kvm_arch_irqfd_allowed (struct kvm *kvm,struct kvm_irqfd *args);void kvm_inject_pending_timer_irqs (struct kvm_vcpu *vcpu);void kvm_inject_apic_timer_irqs (struct kvm_vcpu *vcpu);void kvm_apic_nmi_wd_deliver (struct kvm_vcpu *vcpu);
include/linux/kvm_host.h +1 -0
@@ -990,6 +990,7 @@ void kvm_unregister_irq_ack_notifier(struct kvm *kvm, struct kvm_irq_ack_notifier *kian);int kvm_request_irq_source_id (struct kvm *kvm);void kvm_free_irq_source_id (struct kvm *kvm,int irq_source_id); +bool kvm_arch_irqfd_allowed (struct kvm *kvm,struct kvm_irqfd *args);/* * search_memslots() and __gfn_to_memslot() are here because they are
Signature · 1 line
1.8.3.1
Quoted 38 lines · Yi Wang
We get a warning when build kernel W=1:
arch/x86/kvm/../../../virt/kvm/eventfd.c:48:1: warning: no previous prototype for ‘kvm_arch_irqfd_allowed’ [-Wmissing-prototypes]
kvm_arch_irqfd_allowed(struct kvm *kvm, struct kvm_irqfd *args)
^The reason is
kvm_arch_irqfd_allowed()is declared inarch/x86/kvm/irq.h, which is not included byeventfd.c. Consideringkvm_arch_irqfd_allowed()is a weakly defined function ineventfd.c, remove the declaration tokvm_host.hcan fix this.Signed-off-by Yi Wang <[email protected]>Reviewed-by Sean Christopherson <[email protected]>---
v2: add comments about the reason.--- arch/x86/kvm/irq.h | 1 - include/linux/kvm_host.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)arch/x86/kvm/irq.h +0
-1@@ -102,7 +102,6 @@ static inline int irqchip_in_kernel(struct kvm *kvm)return mode !=KVM_IRQCHIP_NONE ; } -bool kvm_arch_irqfd_allowed (struct kvm *kvm,struct kvm_irqfd *args);void kvm_inject_pending_timer_irqs (struct kvm_vcpu *vcpu);void kvm_inject_apic_timer_irqs (struct kvm_vcpu *vcpu);void kvm_apic_nmi_wd_deliver (struct kvm_vcpu *vcpu);include/linux/kvm_host.h +0
-0
include/linux/kvm_host.h void kvm_unregister_irq_ack_notifier(struct kvm *kvm, · line 996
Quoted 7 lines
include/linux/kvm_host.h +1
-0@@ -990,6 +990,7 @@ void kvm_unregister_irq_ack_notifier(struct kvm *kvm, struct kvm_irq_ack_notifier *kian);int kvm_request_irq_source_id (struct kvm *kvm);void kvm_free_irq_source_id (struct kvm *kvm,int irq_source_id); +bool kvm_arch_irqfd_allowed (struct kvm *kvm,struct kvm_irqfd *args);/* * search_memslots() and __gfn_to_memslot() are here because they are
Queued, thanks.
Paolo