On Fri, Nov 24, 2017 at 10:55:47AM +0100, Greg Kurz wrote: > On Fri, 24 Nov 2017 13:51:00 +1100 > David Gibson <da...@gibson.dropbear.id.au> wrote: > > > On Thu, Nov 23, 2017 at 02:29:31PM +0100, Cédric Le Goater wrote: > > > The sPAPR and the PowerNV core objects create the interrupt presenter > > > object of the CPUs in a very similar way. Let's provide a common > > > routine in which we use the presenter 'type' as a child identifier. > > > > > > Signed-off-by: Cédric Le Goater <c...@kaod.org> > > > > One tiny nit.., apart from that > > > > Reviewed-by: David Gibson <da...@gibson.dropbear.id.au> > > > > > --- > > > hw/intc/xics.c | 22 ++++++++++++++++++++++ > > > hw/ppc/pnv_core.c | 10 +--------- > > > hw/ppc/spapr_cpu_core.c | 13 ++----------- > > > include/hw/ppc/xics.h | 3 +++ > > > 4 files changed, 28 insertions(+), 20 deletions(-) > > > > > > diff --git a/hw/intc/xics.c b/hw/intc/xics.c > > > index a1cc0e420c98..e4ccdff8f577 100644 > > > --- a/hw/intc/xics.c > > > +++ b/hw/intc/xics.c > > > @@ -384,6 +384,28 @@ static const TypeInfo icp_info = { > > > .class_size = sizeof(ICPStateClass), > > > }; > > > > > > +Object *icp_create(CPUState *cs, const char *type, XICSFabric *xi, Error > > > **errp) > > > +{ > > > + Object *child = OBJECT(cs); > > > > In the original context 'child' made sense, since it was the child > > object of the core. Here, it's misleading, since it's the parent of > > the xics link. It's only used in a couple of places, so I suggest you > > Oops yes :) > > > just opencode OBJECT(cs) in each place. > > > > or rename child to owner, as it is done with DRCs and TCE tables.
Sure. Either's fine by me. -- 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
signature.asc
Description: PGP signature