All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: forward declare structs in kvm_types.h
Date: Fri, 29 Aug 2014 16:35:49 +0200	[thread overview]
Message-ID: <54008FC5.2060408@redhat.com> (raw)
In-Reply-To: <20140829124657.GA8674@potion.brq.redhat.com>

Il 29/08/2014 14:46, Radim Krčmář ha scritto:
> 2014-08-29 14:01+0200, Paolo Bonzini:
>> Opaque KVM structs are useful for prototypes in asm/kvm_host.h, to avoid
>> "'struct foo' declared inside parameter list" warnings (and consequent
>> breakage due to conflicting types).
>>
>> Move them from individual files to a generic place in linux/kvm_types.h.
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
> 
> Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>
> 
> (Inclusion of <linux/types.h> seems to be piggybacking, but is a nice
>  thing to do :)

I just wasn't sure if including linux/kvm_types.h was enough alone.

> 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
>  
> -struct kvm;
> -struct kvm_vcpu;
>  extern struct kmem_cache *kvm_vcpu_cache;
>  
>  extern spinlock_t kvm_lock;
> @@ -325,8 +323,6 @@ struct kvm_kernel_irq_routing_entry {
>  	struct hlist_node link;
>  };
>  
> -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, struct kvm_vcpu *vcpu)
>  
>  extern bool kvm_rebooting;
>  
> -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 @@
>  
>  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;
> 

Good idea, thanks.

Paolo

  reply	other threads:[~2014-08-29 14:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29 12:01 [PATCH] KVM: forward declare structs in kvm_types.h Paolo Bonzini
2014-08-29 12:46 ` Radim Krčmář
2014-08-29 14:35   ` Paolo Bonzini [this message]
2014-08-29 13:06 ` Christian Borntraeger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54008FC5.2060408@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.