From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmrfY-00056q-GT for qemu-devel@nongnu.org; Wed, 21 Sep 2016 20:15:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmrfW-0001Lx-AY for qemu-devel@nongnu.org; Wed, 21 Sep 2016 20:15:15 -0400 Date: Thu, 22 Sep 2016 09:40:11 +1000 From: David Gibson Message-ID: <20160921234011.GG1809@umbus.fritz.box> References: <1474266577-11704-1-git-send-email-nikunj@linux.vnet.ibm.com> <1474266577-11704-6-git-send-email-nikunj@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vSsTm1kUtxIHoa7M" Content-Disposition: inline In-Reply-To: <1474266577-11704-6-git-send-email-nikunj@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v4 5/9] 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, benh@kernel.crashing.org, clg@kaod.org --vSsTm1kUtxIHoa7M Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 19, 2016 at 11:59:33AM +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 | 6 +----- > include/hw/ppc/xics.h | 1 + > 3 files changed, 12 insertions(+), 5 deletions(-) >=20 > diff --git a/hw/intc/xics.c b/hw/intc/xics.c > index 05e938f..c7901c4 100644 > --- a/hw/intc/xics.c > +++ b/hw/intc/xics.c > @@ -109,6 +109,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); You'll need to construct a name here so you don't have all the ics objects called an indistinguishable "ics". > + 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 0b0845d..270f20e 100644 > --- a/hw/intc/xics_spapr.c > +++ b/hw/intc/xics_spapr.c > @@ -305,12 +305,8 @@ static void xics_spapr_realize(DeviceState *dev, Err= or **errp) > static void xics_spapr_initfn(Object *obj) > { > XICSState *xics =3D XICS_SPAPR(obj); > - ICSState *ics; > =20 > - 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 e49a2da..a7a1e54 100644 > --- a/include/hw/ppc/xics.h > +++ b/include/hw/ppc/xics.h > @@ -197,5 +197,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 --vSsTm1kUtxIHoa7M Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX4xpXAAoJEGw4ysog2bOSQyMP/jwowWwa1gc3FNF8yKsoZna5 ChLE7iGQWduuKNfyoIwIk6acb4ttJ9pt9k5mmLaYvFvKkasZFcOhvMJhYzbC2MmU i/plGxHtTkmRSeF9CQ9O+T/kqmA/GZ8WNlCiY5lJJ4L59NBgh0o09nkaGOO+zsAX 6wLX6Y5uPu+upEeld2lYsN4z0hsBXY79otwjF7qUNKTNPXOyPPFCKbB3PgRIhDsA UTDjWqvI/T2Rz3AN3L+cf0RCsBC49NSVUu7k8gY4Wg0F28Mmc8BftoDO5anAyWWN yX+Un7DQOY2KfPotUjNc6o2S4mdWErJDKvYkJD0GYdGV3yplN8kZhJpPDDZaP/hG SMka6uX4Pgar+44Db/hZis3xdn0OlFrMDsbVCYfv6D4LQsVxJgmDZDyTG/hpd6Il fTMMsAbmIBPGAvjjUU8nWMsSnt06wst+7zaGRNxXLO6HQFUdMTfD5k4VjeC4vuAW p93RB9EbDaXUbenmNjcdWoosPdwoqW27gz2qVzKZVsd/QnWj9x3Ixnq6hZL/vlLI MFfT3itirKbr52hvtQBTJ60JXXUtsoCLjl8h4pMgwjixIHOA7xsZuDq5+vV2XcrT rZ8x/k5Zm+7OCKr6E8sRPY6vrl2QvjI6mXoIQyjamGRwoGfl/3pOTDFCHdsVIeZ2 j00zpXlwiJdXRtYcIAN9 =eqOj -----END PGP SIGNATURE----- --vSsTm1kUtxIHoa7M--