From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHOSL-0006UN-4F for qemu-devel@nongnu.org; Mon, 27 Jun 2016 00:47:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHOSH-0001vl-Rw for qemu-devel@nongnu.org; Mon, 27 Jun 2016 00:47:33 -0400 Date: Mon, 27 Jun 2016 14:21:14 +1000 From: David Gibson Message-ID: <20160627042114.GG4242@voom.fritz.box> References: <1466704050-15108-1-git-send-email-nikunj@linux.vnet.ibm.com> <1466704050-15108-9-git-send-email-nikunj@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lQSB8Tqijvu1+4Ba" Content-Disposition: inline In-Reply-To: <1466704050-15108-9-git-send-email-nikunj@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v1 08/11] ppc/xics: Use a helper to add a new ICS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikunj A Dadhania Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, clg@kaod.org, Benjamin Herrenschmidt --lQSB8Tqijvu1+4Ba Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 23, 2016 at 11:17:27PM +0530, Nikunj A Dadhania wrote: > From: Benjamin Herrenschmidt >=20 > Signed-off-by: Benjamin Herrenschmidt > [Move object allocation and adding child to the helper] > Signed-off-by: Nikunj A Dadhania Reviewed-by: David Gibson > --- > hw/intc/xics.c | 10 ++++++++++ > hw/intc/xics_spapr.c | 7 +------ > include/hw/ppc/xics.h | 1 + > 3 files changed, 12 insertions(+), 6 deletions(-) >=20 > diff --git a/hw/intc/xics.c b/hw/intc/xics.c > index ef2a1e4..326d21f 100644 > --- a/hw/intc/xics.c > +++ b/hw/intc/xics.c > @@ -108,6 +108,16 @@ static void xics_common_reset(DeviceState *d) > } > } > =20 > +void xics_add_ics(XICSState *xics) > +{ > + ICSState *ics; > + > + ics =3D ICS(object_new(TYPE_ICS)); > + object_property_add_child(OBJECT(xics), "ics", OBJECT(ics), NULL); > + ics->xics =3D xics; > + QLIST_INSERT_HEAD(&xics->ics, ics, list); > +} > + > static void xics_prop_get_nr_irqs(Object *obj, Visitor *v, const char *n= ame, > void *opaque, Error **errp) > { > diff --git a/hw/intc/xics_spapr.c b/hw/intc/xics_spapr.c > index b03dd0d..8acafd9 100644 > --- a/hw/intc/xics_spapr.c > +++ b/hw/intc/xics_spapr.c > @@ -289,14 +289,9 @@ static void xics_spapr_realize(DeviceState *dev, Err= or **errp) > static void xics_spapr_initfn(Object *obj) > { > XICSState *xics =3D XICS(obj); > - ICSState *ics; > =20 > QLIST_INIT(&xics->ics); > - > - ics =3D ICS(object_new(TYPE_ICS)); > - object_property_add_child(obj, "ics", OBJECT(ics), NULL); > - ics->xics =3D xics; > - QLIST_INSERT_HEAD(&xics->ics, ics, list); > + xics_add_ics(xics); > } > =20 > static void xics_spapr_class_init(ObjectClass *oc, void *data) > diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h > index 3c63c36..ee0fce2 100644 > --- a/include/hw/ppc/xics.h > +++ b/include/hw/ppc/xics.h > @@ -195,5 +195,6 @@ void ics_write_xive(ICSState *ics, int nr, int server, > void ics_set_irq_type(ICSState *ics, int srcno, bool lsi); > =20 > ICSState *xics_find_source(XICSState *icp, int irq); > +void xics_add_ics(XICSState *xics); > =20 > #endif /* __XICS_H__ */ --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --lQSB8Tqijvu1+4Ba Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXcKm5AAoJEGw4ysog2bOSmrYQAJqA/R4dt66IFkTpie+BCPlD UbpxDnQfD40FzFdQDNVqLaLHTILcPiFk2J1oHOmZFmkjXB7P2VKTg6QhXdckhfET 5YnLl5LxXa6wsGUoMx057uAWidmkitKiTV/iIrf+MY5rxclXIJJ/xO963hLmXtmi el0ixtOaut7Zfs6BR8dfmVtJm5LnYvtyBVxG9QZAmkieXm0ebdxqoVVLxlNkH4KL 0P9fcHrheGS4GmHj8hGV4GsWkJfe4206fyZpHdyAZgQBwnAccl2ReKBem/me33yL /zjVvD6CTEktY4mx3ji4gRD6wg8mSd2NCa/j+8HEIAxs4WpJUDO5lPu7b6SUqgAJ NPQe8yH0hkZma9PjZl99tVwNw7GokpsKMMZuxj1kUo6E9ptNNQK8HRHYGaSFe8A9 7rqNPduJnpbBaVR+p+w8hcDXh3PjxQYLqSYGzBdZy4hfm+R+Jf1mC5AaY4IcBTQq kX7IS/dVUaFQRK/qvfZ15TjL8DxccVi1D/ktdUQSCpEA3qshz+GUxkafLWeE1L4a 6MA5PZKH5KDgYSh50Z7K+iRIGCgrkGBp5VtrRlWD55zbfI3QGqSWf+rAE3JYaruZ dSq4Jz7wJyEXfFHsln9MGyh5PhA3dMCha3sFTam/hBHwkuckoXb2MO7ez2sDRbRr G/N2HScFs1FtYO/IbuFw =3Bl4 -----END PGP SIGNATURE----- --lQSB8Tqijvu1+4Ba--