* [PATCH] bcm2836: Remove redundant typedef and macros
@ 2021-08-05 21:47 Eduardo Habkost
2021-08-06 12:45 ` Daniel P. Berrangé
0 siblings, 1 reply; 2+ messages in thread
From: Eduardo Habkost @ 2021-08-05 21:47 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Daniel P. Berrange, Philippe Mathieu-Daudé,
Andrew Baumann, qemu-arm, Paolo Bonzini, Luc Michel
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.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Cc: Luc Michel <luc.michel@greensocs.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/bcm2836.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c
index 24354338cad..f894338fc6a 100644
--- a/hw/arm/bcm2836.c
+++ b/hw/arm/bcm2836.c
@@ -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);
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bcm2836: Remove redundant typedef and macros
2021-08-05 21:47 [PATCH] bcm2836: Remove redundant typedef and macros Eduardo Habkost
@ 2021-08-06 12:45 ` Daniel P. Berrangé
0 siblings, 0 replies; 2+ messages in thread
From: Daniel P. Berrangé @ 2021-08-06 12:45 UTC (permalink / raw)
To: Eduardo Habkost
Cc: Peter Maydell, qemu-devel, Andrew Baumann,
Philippe Mathieu-Daudé, qemu-arm, Paolo Bonzini, Luc Michel
On Thu, Aug 05, 2021 at 05:47:39PM -0400, Eduardo Habkost wrote:
> 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.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Cc: Luc Michel <luc.michel@greensocs.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> ---
> hw/arm/bcm2836.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Regards,
Daniel
--
|: 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 :|
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-06 12:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-05 21:47 [PATCH] bcm2836: Remove redundant typedef and macros Eduardo Habkost
2021-08-06 12:45 ` Daniel P. Berrangé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).