diff mbox series

[v2,3/3] spapr: Remove unnecessary DRC type-checker macros

Message ID 20200831235146.36045-4-david@gibson.dropbear.id.au
State New
Headers show
Series ppc: Fixes for class and instance size problems | expand

Commit Message

David Gibson Aug. 31, 2020, 11:51 p.m. UTC
spapr_drc.h includes typechecker macro boilerplate for the many different
DRC subclasses.  However, most of these types don't actually have different
data in their class and/or instance, making these unneeded, unused, and in
fact a bad idea.  Remove them.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 include/hw/ppc/spapr_drc.h | 43 +-------------------------------------
 1 file changed, 1 insertion(+), 42 deletions(-)

Comments

Greg Kurz Sept. 1, 2020, 10:27 a.m. UTC | #1
On Tue,  1 Sep 2020 09:51:46 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:

> spapr_drc.h includes typechecker macro boilerplate for the many different
> DRC subclasses.  However, most of these types don't actually have different
> data in their class and/or instance, making these unneeded, unused, and in
> fact a bad idea.  Remove them.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---

Reviewed-by: Greg Kurz <groug@kaod.org>


>  include/hw/ppc/spapr_drc.h | 43 +-------------------------------------
>  1 file changed, 1 insertion(+), 42 deletions(-)
> 
> diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h
> index 21af8deac1..f270860769 100644
> --- a/include/hw/ppc/spapr_drc.h
> +++ b/include/hw/ppc/spapr_drc.h
> @@ -29,62 +29,21 @@
>                                               TYPE_SPAPR_DR_CONNECTOR)
>  
>  #define TYPE_SPAPR_DRC_PHYSICAL "spapr-drc-physical"
> -#define SPAPR_DRC_PHYSICAL_GET_CLASS(obj) \
> -        OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PHYSICAL)
> -#define SPAPR_DRC_PHYSICAL_CLASS(klass) \
> -        OBJECT_CLASS_CHECK(SpaprDrcClass, klass, \
> -                           TYPE_SPAPR_DRC_PHYSICAL)
>  #define SPAPR_DRC_PHYSICAL(obj) OBJECT_CHECK(SpaprDrcPhysical, (obj), \
>                                               TYPE_SPAPR_DRC_PHYSICAL)
>  
>  #define TYPE_SPAPR_DRC_LOGICAL "spapr-drc-logical"
> -#define SPAPR_DRC_LOGICAL_GET_CLASS(obj) \
> -        OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_LOGICAL)
> -#define SPAPR_DRC_LOGICAL_CLASS(klass) \
> -        OBJECT_CLASS_CHECK(SpaprDrcClass, klass, \
> -                           TYPE_SPAPR_DRC_LOGICAL)
> -#define SPAPR_DRC_LOGICAL(obj) OBJECT_CHECK(SpaprDrc, (obj), \
> -                                             TYPE_SPAPR_DRC_LOGICAL)
>  
>  #define TYPE_SPAPR_DRC_CPU "spapr-drc-cpu"
> -#define SPAPR_DRC_CPU_GET_CLASS(obj) \
> -        OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_CPU)
> -#define SPAPR_DRC_CPU_CLASS(klass) \
> -        OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_CPU)
> -#define SPAPR_DRC_CPU(obj) OBJECT_CHECK(SpaprDrc, (obj), \
> -                                        TYPE_SPAPR_DRC_CPU)
>  
>  #define TYPE_SPAPR_DRC_PCI "spapr-drc-pci"
> -#define SPAPR_DRC_PCI_GET_CLASS(obj) \
> -        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), \
> -                                        TYPE_SPAPR_DRC_PCI)
>  
>  #define TYPE_SPAPR_DRC_LMB "spapr-drc-lmb"
> -#define SPAPR_DRC_LMB_GET_CLASS(obj) \
> -        OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_LMB)
> -#define SPAPR_DRC_LMB_CLASS(klass) \
> -        OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_LMB)
> -#define SPAPR_DRC_LMB(obj) OBJECT_CHECK(SpaprDrc, (obj), \
> -                                        TYPE_SPAPR_DRC_LMB)
>  
>  #define TYPE_SPAPR_DRC_PHB "spapr-drc-phb"
> -#define SPAPR_DRC_PHB_GET_CLASS(obj) \
> -        OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PHB)
> -#define SPAPR_DRC_PHB_CLASS(klass) \
> -        OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_PHB)
> -#define SPAPR_DRC_PHB(obj) OBJECT_CHECK(SpaprDrc, (obj), \
> -                                        TYPE_SPAPR_DRC_PHB)
>  
>  #define TYPE_SPAPR_DRC_PMEM "spapr-drc-pmem"
> -#define SPAPR_DRC_PMEM_GET_CLASS(obj) \
> -        OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PMEM)
> -#define SPAPR_DRC_PMEM_CLASS(klass) \
> -        OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_PMEM)
> -#define SPAPR_DRC_PMEM(obj) OBJECT_CHECK(SpaprDrc, (obj), \
> -                                         TYPE_SPAPR_DRC_PMEM)
> +
>  /*
>   * Various hotplug types managed by SpaprDrc
>   *
diff mbox series

Patch

diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h
index 21af8deac1..f270860769 100644
--- a/include/hw/ppc/spapr_drc.h
+++ b/include/hw/ppc/spapr_drc.h
@@ -29,62 +29,21 @@ 
                                              TYPE_SPAPR_DR_CONNECTOR)
 
 #define TYPE_SPAPR_DRC_PHYSICAL "spapr-drc-physical"
-#define SPAPR_DRC_PHYSICAL_GET_CLASS(obj) \
-        OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PHYSICAL)
-#define SPAPR_DRC_PHYSICAL_CLASS(klass) \
-        OBJECT_CLASS_CHECK(SpaprDrcClass, klass, \
-                           TYPE_SPAPR_DRC_PHYSICAL)
 #define SPAPR_DRC_PHYSICAL(obj) OBJECT_CHECK(SpaprDrcPhysical, (obj), \
                                              TYPE_SPAPR_DRC_PHYSICAL)
 
 #define TYPE_SPAPR_DRC_LOGICAL "spapr-drc-logical"
-#define SPAPR_DRC_LOGICAL_GET_CLASS(obj) \
-        OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_LOGICAL)
-#define SPAPR_DRC_LOGICAL_CLASS(klass) \
-        OBJECT_CLASS_CHECK(SpaprDrcClass, klass, \
-                           TYPE_SPAPR_DRC_LOGICAL)
-#define SPAPR_DRC_LOGICAL(obj) OBJECT_CHECK(SpaprDrc, (obj), \
-                                             TYPE_SPAPR_DRC_LOGICAL)
 
 #define TYPE_SPAPR_DRC_CPU "spapr-drc-cpu"
-#define SPAPR_DRC_CPU_GET_CLASS(obj) \
-        OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_CPU)
-#define SPAPR_DRC_CPU_CLASS(klass) \
-        OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_CPU)
-#define SPAPR_DRC_CPU(obj) OBJECT_CHECK(SpaprDrc, (obj), \
-                                        TYPE_SPAPR_DRC_CPU)
 
 #define TYPE_SPAPR_DRC_PCI "spapr-drc-pci"
-#define SPAPR_DRC_PCI_GET_CLASS(obj) \
-        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), \
-                                        TYPE_SPAPR_DRC_PCI)
 
 #define TYPE_SPAPR_DRC_LMB "spapr-drc-lmb"
-#define SPAPR_DRC_LMB_GET_CLASS(obj) \
-        OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_LMB)
-#define SPAPR_DRC_LMB_CLASS(klass) \
-        OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_LMB)
-#define SPAPR_DRC_LMB(obj) OBJECT_CHECK(SpaprDrc, (obj), \
-                                        TYPE_SPAPR_DRC_LMB)
 
 #define TYPE_SPAPR_DRC_PHB "spapr-drc-phb"
-#define SPAPR_DRC_PHB_GET_CLASS(obj) \
-        OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PHB)
-#define SPAPR_DRC_PHB_CLASS(klass) \
-        OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_PHB)
-#define SPAPR_DRC_PHB(obj) OBJECT_CHECK(SpaprDrc, (obj), \
-                                        TYPE_SPAPR_DRC_PHB)
 
 #define TYPE_SPAPR_DRC_PMEM "spapr-drc-pmem"
-#define SPAPR_DRC_PMEM_GET_CLASS(obj) \
-        OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PMEM)
-#define SPAPR_DRC_PMEM_CLASS(klass) \
-        OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_PMEM)
-#define SPAPR_DRC_PMEM(obj) OBJECT_CHECK(SpaprDrc, (obj), \
-                                         TYPE_SPAPR_DRC_PMEM)
+
 /*
  * Various hotplug types managed by SpaprDrc
  *