qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: peter.crosthwaite@xilinx.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RfC PATCH 3/5] usb/ehci: seperate out PCIisms
Date: Thu, 01 Nov 2012 09:39:32 +0100	[thread overview]
Message-ID: <50923544.4090705@redhat.com> (raw)
In-Reply-To: <50914C65.8040303@suse.de>

  Hi,

>> -static int usb_ehci_initfn(PCIDevice *dev)
>> +static void usb_ehci_initfn(EHCIState *s, DeviceState *dev)
>>  {
>> -    EHCIState *s = DO_UPCAST(EHCIState, dev, dev);

>> +static int usb_ehci_pci_initfn(PCIDevice *dev)
>> +{
>> +    EHCIPCIState *i = DO_UPCAST(EHCIPCIState, pcidev, dev);
> 
> Same as discussed for Peter's patchset, this should be using a QOM cast
> macro and may need an abstract base type if there is no unique type
> matching EHCIPCIState struct.

--verbose please.

This is exactly like it used to be.  PCIDeviceClass->init() gets passed
in a PCIDevice pointer and uses DO_UPCAST to get the container struct
carrying the ehci state (EHCIState before the patch, EHCIPCIState now).
 This is common practice all over the tree.

> Should I send you a follow-up to squash if this is the approach we are
> going to take?

If there is a new, more QOM-ish way to do the same feel free to send
patches.  I see that as independent cleanup though, not as something
which should be squashed into this patch.

cheers,
  Gerd

  reply	other threads:[~2012-11-01  8:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-30 11:28 [Qemu-devel] [RfC PATCH 0/5] ehci pci splitup Gerd Hoffmann
2012-10-30 11:28 ` [Qemu-devel] [RfC PATCH 1/5] usb/ehci: parameterise the register region offsets Gerd Hoffmann
2012-10-30 12:41   ` Andreas Färber
2012-10-30 11:28 ` [Qemu-devel] [RfC PATCH 2/5] usb/ehci: Abstract away PCI DMA API Gerd Hoffmann
2012-10-30 12:42   ` Andreas Färber
2012-10-30 11:28 ` [Qemu-devel] [RfC PATCH 3/5] usb/ehci: seperate out PCIisms Gerd Hoffmann
2012-10-31 16:05   ` Andreas Färber
2012-11-01  8:39     ` Gerd Hoffmann [this message]
2012-10-30 11:28 ` [Qemu-devel] [RfC PATCH 4/5] usb/ehci: Guard definition of EHCI_DEBUG Gerd Hoffmann
2012-10-30 11:28 ` [Qemu-devel] [RfC PATCH 5/5] usb/ehci: split into multiple source files Gerd Hoffmann
2012-10-30 13:13 ` [Qemu-devel] [RfC PATCH 0/5] ehci pci splitup Peter Crosthwaite
2012-10-30 14:14   ` Gerd Hoffmann

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=50923544.4090705@redhat.com \
    --to=kraxel@redhat.com \
    --cc=afaerber@suse.de \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=qemu-devel@nongnu.org \
    /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 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).