* [PATCH v2] kvm: x86: Fix -Wmissing-prototypes warnings
@ 2019-07-10 0:24 Yi Wang
2019-07-10 14:36 ` Paolo Bonzini
0 siblings, 1 reply; 3+ messages in thread
From: Yi Wang @ 2019-07-10 0:24 UTC (permalink / raw)
To: pbonzini
Cc: rkrcmar, tglx, mingo, bp, hpa, x86, kvm, linux-kernel,
xue.zhihong, wang.yi59, sean.j.christopherson, up2wing,
wang.liang82
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.
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
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(-)
diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h
index d6519a3..7c6233d 100644
--- a/arch/x86/kvm/irq.h
+++ b/arch/x86/kvm/irq.h
@@ -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);
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index d1ad38a..5f04005 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -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
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] kvm: x86: Fix -Wmissing-prototypes warnings
2019-07-10 0:24 [PATCH v2] kvm: x86: Fix -Wmissing-prototypes warnings Yi Wang
@ 2019-07-10 14:36 ` Paolo Bonzini
0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2019-07-10 14:36 UTC (permalink / raw)
To: Yi Wang
Cc: rkrcmar, tglx, mingo, bp, hpa, x86, kvm, linux-kernel,
xue.zhihong, sean.j.christopherson, up2wing, wang.liang82
On 10/07/19 02:24, Yi Wang wrote:
> 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.
>
> Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
> Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
> ---
> 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(-)
>
> diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h
> index d6519a3..7c6233d 100644
> --- a/arch/x86/kvm/irq.h
> +++ b/arch/x86/kvm/irq.h
> @@ -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);
> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> index d1ad38a..5f04005 100644
> --- a/include/linux/kvm_host.h
> +++ b/include/linux/kvm_host.h
> @@ -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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] kvm: x86: Fix -Wmissing-prototypes warnings
@ 2019-07-10 0:20 Yi Wang
0 siblings, 0 replies; 3+ messages in thread
From: Yi Wang @ 2019-07-10 0:20 UTC (permalink / raw)
To: linux-kernel; +Cc: xue.zhihong, wang.yi59, up2wing, wang.liang82
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.
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
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(-)
diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h
index d6519a3..7c6233d 100644
--- a/arch/x86/kvm/irq.h
+++ b/arch/x86/kvm/irq.h
@@ -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);
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index d1ad38a..5f04005 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -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
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-10 14:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-10 0:24 [PATCH v2] kvm: x86: Fix -Wmissing-prototypes warnings Yi Wang
2019-07-10 14:36 ` Paolo Bonzini
-- strict thread matches above, loose matches on Subject: below --
2019-07-10 0:20 Yi Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).