TYPE_SPAPR_DRC_PCI inherits from TYPE_SPAPR_DRC_PHYSICAL, so its checker
macro should use the corresponding instance type. We got away with it
because we never actually used that checker macro.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
include/hw/ppc/spapr_drc.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h
index 21af8deac1..baaaba3c1f 100644
--- a/include/hw/ppc/spapr_drc.h
+++ b/include/hw/ppc/spapr_drc.h
@@ -59,7 +59,7 @@
OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PCI)
#define SPAPR_DRC_PCI_CLASS(klass) \
OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_PCI)
-#define SPAPR_DRC_PCI(obj) OBJECT_CHECK(SpaprDrc, (obj), \
+#define SPAPR_DRC_PCI(obj) OBJECT_CHECK(SpaprDrcPhysical, (obj), \
TYPE_SPAPR_DRC_PCI)
#define TYPE_SPAPR_DRC_LMB "spapr-drc-lmb"
--
2.26.2
On Tue, Aug 25, 2020 at 09:16:27PM +1000, David Gibson wrote: > TYPE_SPAPR_DRC_PCI inherits from TYPE_SPAPR_DRC_PHYSICAL, so its checker > macro should use the corresponding instance type. We got away with it > because we never actually used that checker macro. > > Signed-off-by: David Gibson <david@gibson.dropbear.id.au> > --- > include/hw/ppc/spapr_drc.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h > index 21af8deac1..baaaba3c1f 100644 > --- a/include/hw/ppc/spapr_drc.h > +++ b/include/hw/ppc/spapr_drc.h > @@ -59,7 +59,7 @@ > OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PCI) > #define SPAPR_DRC_PCI_CLASS(klass) \ > OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_PCI) > -#define SPAPR_DRC_PCI(obj) OBJECT_CHECK(SpaprDrc, (obj), \ > +#define SPAPR_DRC_PCI(obj) OBJECT_CHECK(SpaprDrcPhysical, (obj), \ > TYPE_SPAPR_DRC_PCI) I'm not sure this is really what we want to do. This is what triggered the warning in my script, but it doesn't mean we want to use SpaprDrcPhysical here. Code that needs a SpaprDrc* can use SPAPR_DR_CONNECTOR(); code that needs a SpaprDrcPhysical* can use SPAPR_DRC_PHYSICAL(). All the other OBJECT_CHECK(SpaprDrc, ...) and OBJECT_CHECK(SpaprDrcPhysical, ...) macros seem unnecessary. -- Eduardo
On Wed, Aug 26, 2020 at 12:21:37PM -0400, Eduardo Habkost wrote: > On Tue, Aug 25, 2020 at 09:16:27PM +1000, David Gibson wrote: > > TYPE_SPAPR_DRC_PCI inherits from TYPE_SPAPR_DRC_PHYSICAL, so its checker > > macro should use the corresponding instance type. We got away with it > > because we never actually used that checker macro. > > > > Signed-off-by: David Gibson <david@gibson.dropbear.id.au> > > --- > > include/hw/ppc/spapr_drc.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h > > index 21af8deac1..baaaba3c1f 100644 > > --- a/include/hw/ppc/spapr_drc.h > > +++ b/include/hw/ppc/spapr_drc.h > > @@ -59,7 +59,7 @@ > > OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PCI) > > #define SPAPR_DRC_PCI_CLASS(klass) \ > > OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_PCI) > > -#define SPAPR_DRC_PCI(obj) OBJECT_CHECK(SpaprDrc, (obj), \ > > +#define SPAPR_DRC_PCI(obj) OBJECT_CHECK(SpaprDrcPhysical, (obj), \ > > TYPE_SPAPR_DRC_PCI) > > I'm not sure this is really what we want to do. This is what > triggered the warning in my script, but it doesn't mean we want > to use SpaprDrcPhysical here. > > Code that needs a SpaprDrc* can use SPAPR_DR_CONNECTOR(); > code that needs a SpaprDrcPhysical* can use SPAPR_DRC_PHYSICAL(). > All the other OBJECT_CHECK(SpaprDrc, ...) and > OBJECT_CHECK(SpaprDrcPhysical, ...) macros seem unnecessary. Good point. I've rewritten and am resending. -- 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
© 2016 - 2026 Red Hat, Inc.