From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtnjY-0002gv-83 for qemu-devel@nongnu.org; Mon, 01 Jul 2013 19:42:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UtnjX-0005Vy-8p for qemu-devel@nongnu.org; Mon, 01 Jul 2013 19:42:12 -0400 Received: from cantor2.suse.de ([195.135.220.15]:50946 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtnjW-0005Vt-Vr for qemu-devel@nongnu.org; Mon, 01 Jul 2013 19:42:11 -0400 Message-ID: <51D213CE.6010003@suse.de> Date: Tue, 02 Jul 2013 01:42:06 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1372169705-7645-1-git-send-email-pbonzini@redhat.com> <1372169705-7645-25-git-send-email-pbonzini@redhat.com> In-Reply-To: <1372169705-7645-25-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 24/24] hw/[u-x]*: pass owner to memory_region_init_io List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: peter.maydell@linaro.org, alex.williamson@redhat.com, qemu-devel@nongnu.org, Anthony Liguori Am 25.06.2013 16:15, schrieb Paolo Bonzini: > Signed-off-by: Paolo Bonzini > --- > 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(-) >=20 > 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 =3D FUSBH200_EHCI(obj); > EHCIState *s =3D &i->ehci; > =20 > - memory_region_init_io(&f->mem_vendor, NULL, &fusbh200_ehci_mmio_op= s, s, > + memory_region_init_io(&f->mem_vendor, OBJECT(f), &fusbh200_ehci_mm= io_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 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg