Skip to contentSkip to conversation

bcm2836: Remove redundant typedef and macros

PATCH In review Eduardo Habkost 2 participants 2 messages Aug 5, 2021 – Aug 6, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bcm2836: Remove redundant typedef and macros

commit 58b350280e97 ("hw/arm/bcm2836: Restrict BCM283XInfo declaration to C source") didn't just move the struct BCM283XClass definition to bcm2836.c. It also introduced a typedef (BCM283XClass) and two type checking macros (BCM283X_CLASS, BCM283X_GET_CLASS).

The typedef and macros duplicate what is already defined by the OBJECT_DECLARE_TYPE declaration at bcm2836.h. Remove the redundant declarations.

---
Cc: Philippe Mathieu-Daudé <[email protected]>
Cc: Luc Michel <[email protected]>
Cc: Peter Maydell <[email protected]>

---
 hw/arm/bcm2836.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
hw/arm/bcm2836.c +2 -7
index 24354338cad..f894338fc6a 100644
@@ -16,7 +16,7 @@
 #include "hw/arm/raspi_platform.h"
 #include "hw/sysbus.h"
 
-typedef struct BCM283XClass {
+struct BCM283XClass {
     /*< private >*/
     DeviceClass parent_class;
     /*< public >*/
@@ -26,12 +26,7 @@ typedef struct BCM283XClass {
     hwaddr peri_base; /* Peripheral base address seen by the CPU */
     hwaddr ctrl_base; /* Interrupt controller and mailboxes etc. */
     int clusterid;
-} BCM283XClass;
-
-#define BCM283X_CLASS(klass) \
-    OBJECT_CLASS_CHECK(BCM283XClass, (klass), TYPE_BCM283X)
-#define BCM283X_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(BCM283XClass, (obj), TYPE_BCM283X)
+};
 
 static Property bcm2836_enabled_cores_property =
     DEFINE_PROP_UINT32("enabled-cpus", BCM283XState, enabled_cpus, 0);
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Eduardo Habkost

commit 58b350280e97 ("hw/arm/bcm2836: Restrict BCM283XInfo declaration to C source") didn't just move the struct BCM283XClass definition to bcm2836.c. It also introduced a typedef (BCM283XClass) and two type checking macros (BCM283X_CLASS, BCM283X_GET_CLASS).

The typedef and macros duplicate what is already defined by the OBJECT_DECLARE_TYPE declaration at bcm2836.h. Remove the redundant declarations.

Quoted 8 lines

---
Cc: Philippe Mathieu-Daudé <[email protected]>
Cc: Luc Michel <[email protected]>
Cc: Peter Maydell <[email protected]>

---
 hw/arm/bcm2836.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|