From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH] KVM: forward declare structs in kvm_types.h Date: Fri, 29 Aug 2014 14:46:58 +0200 Message-ID: <20140829124657.GA8674@potion.brq.redhat.com> References: <1409313707-7791-1-git-send-email-pbonzini@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org To: Paolo Bonzini Return-path: Content-Disposition: inline In-Reply-To: <1409313707-7791-1-git-send-email-pbonzini@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2014-08-29 14:01+0200, Paolo Bonzini: > Opaque KVM structs are useful for prototypes in asm/kvm_host.h, to av= oid > "'struct foo' declared inside parameter list" warnings (and consequen= t > breakage due to conflicting types). >=20 > Move them from individual files to a generic place in linux/kvm_types= =2Eh. >=20 > Signed-off-by: Paolo Bonzini > --- Reviewed-by: Radim Kr=C4=8Dm=C3=A1=C5=99 (Inclusion of seems to be piggybacking, but is a nice thing to do :) And I'd apply these changes: (Definitely the first hunk.) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 33d8d0a..e098dce 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -140,8 +140,6 @@ static inline bool is_error_page(struct page *page) #define KVM_USERSPACE_IRQ_SOURCE_ID 0 #define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1 =20 -struct kvm; -struct kvm_vcpu; extern struct kmem_cache *kvm_vcpu_cache; =20 extern spinlock_t kvm_lock; @@ -325,8 +323,6 @@ struct kvm_kernel_irq_routing_entry { struct hlist_node link; }; =20 -struct kvm_irq_routing_table; - #ifndef KVM_PRIVATE_MEM_SLOTS #define KVM_PRIVATE_MEM_SLOTS 0 #endif @@ -1036,8 +1032,6 @@ static inline bool kvm_check_request(int req, str= uct kvm_vcpu *vcpu) =20 extern bool kvm_rebooting; =20 -struct kvm_device_ops; - struct kvm_device { struct kvm_device_ops *ops; struct kvm *kvm; diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h index 1d6daca..53c4f20 100644 --- a/include/linux/kvm_types.h +++ b/include/linux/kvm_types.h @@ -19,7 +19,9 @@ =20 struct kvm; struct kvm_async_pf; +struct kvm_device_ops; struct kvm_interrupt; +struct kvm_irq_routing_table; struct kvm_memory_slot; struct kvm_one_reg; struct kvm_run;