qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: peter.maydell@linaro.org, alex.williamson@redhat.com,
	qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [Qemu-devel] [PATCH 24/24] hw/[u-x]*: pass owner to memory_region_init_io
Date: Tue, 02 Jul 2013 01:42:06 +0200	[thread overview]
Message-ID: <51D213CE.6010003@suse.de> (raw)
In-Reply-To: <1372169705-7645-25-git-send-email-pbonzini@redhat.com>

Am 25.06.2013 16:15, schrieb Paolo Bonzini:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/usb/hcd-ehci-sysbus.c   |  2 +-
>  hw/usb/hcd-ehci.c          |  8 ++++----
>  hw/usb/hcd-ohci.c          |  3 ++-
>  hw/usb/hcd-uhci.c          |  4 +++-
>  hw/usb/hcd-xhci.c          | 12 ++++++------
>  hw/virtio/virtio-pci.c     |  4 ++--
>  hw/watchdog/wdt_i6300esb.c |  3 ++-
>  hw/xen/xen_apic.c          |  4 ++--
>  hw/xen/xen_platform.c      |  7 ++++---
>  hw/xen/xen_pt.c            |  4 ++--
>  hw/xen/xen_pt_msi.c        |  3 ++-
>  hw/xtensa/xtensa_lx60.c    |  2 +-
>  12 files changed, 31 insertions(+), 25 deletions(-)
> 
> diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c
> index 76b4c05..54147b5 100644
> --- a/hw/usb/hcd-ehci-sysbus.c
> +++ b/hw/usb/hcd-ehci-sysbus.c
> @@ -173,7 +173,7 @@ static void fusbh200_ehci_init(Object *obj)
>      FUSBH200EHCIState *f = FUSBH200_EHCI(obj);
>      EHCIState *s = &i->ehci;
>  
> -    memory_region_init_io(&f->mem_vendor, NULL, &fusbh200_ehci_mmio_ops, s,
> +    memory_region_init_io(&f->mem_vendor, OBJECT(f), &fusbh200_ehci_mmio_ops, s,
>                            "fusbh200", 0x4c);
>      memory_region_add_subregion(&s->mem,
>                                  s->opregbase + s->portscbase + 4 * s->portnr,
[snip]

I happened to notice that the scripted approach you describe in the
cover letter causes some unnecessary indirection here:
In this hunk a human could've just supplied the function argument obj.
But since OBJECT() is not a dynamic cast and f is referenced on the same
line for the MemoryRegion itself, I guess there is no harm in always
using OBJECT(f) for simplicity.

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2013-07-01 23:42 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-25 14:14 [Qemu-devel] [PATCH 00/24] Memory patches, part 4: region ownership (devices part) Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 01/24] escc: rename struct to ESCCState Paolo Bonzini
2013-06-25 15:10   ` Andreas Färber
2013-06-25 14:14 ` [Qemu-devel] [PATCH 02/24] vga: pass owner to vga_init Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 03/24] vga: pass owner to vga_common_init Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 04/24] vga: pass owner to cirrus_init_common Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 05/24] vga: pass owner to vga_init_vbe Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 06/24] vga: pass owner to vga_init_io Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 07/24] vga: set owner in vga_update_memory_access Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 08/24] ne2000: pass device to ne2000_setup_io, use it as owner Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 09/24] vfio: pass device to vfio_mmap_bar and use it to set owner Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 10/24] spapr_iommu: pass device to spapr_tce_new_table " Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 11/24] pam: pass device to init_pam " Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 12/24] piolist: add owner argument to initialization functions and pass devices Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 13/24] hw/a*: pass owner to memory_region_init_io Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 14/24] hw/block: " Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 15/24] hw/c*: " Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 16/24] hw/d*: " Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 17/24] hw/gpio: " Paolo Bonzini
2013-06-25 14:14 ` [Qemu-devel] [PATCH 18/24] hw/i*: " Paolo Bonzini
2013-07-01 23:27   ` Andreas Färber
2013-06-25 14:15 ` [Qemu-devel] [PATCH 19/24] hw/m*: " Paolo Bonzini
2013-06-25 14:15 ` [Qemu-devel] [PATCH 20/24] hw/n*: " Paolo Bonzini
2013-06-25 14:15 ` [Qemu-devel] [PATCH 21/24] hw/p*: " Paolo Bonzini
2013-07-01 23:31   ` Andreas Färber
2013-07-02  6:43     ` Paolo Bonzini
2013-06-25 14:15 ` [Qemu-devel] [PATCH 22/24] hw/s*: " Paolo Bonzini
2013-06-25 14:15 ` [Qemu-devel] [PATCH 23/24] hw/t*: " Paolo Bonzini
2013-06-25 14:15 ` [Qemu-devel] [PATCH 24/24] hw/[u-x]*: " Paolo Bonzini
2013-07-01 23:42   ` Andreas Färber [this message]
2013-07-02  5:49     ` Paolo Bonzini

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=51D213CE.6010003@suse.de \
    --to=afaerber@suse.de \
    --cc=alex.williamson@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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).