[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 06/13] hw/arm/bcm2836: Restrict BCM283XClass declaration t
From: |
Luc Michel |
Subject: |
Re: [PATCH v2 06/13] hw/arm/bcm2836: Restrict BCM283XClass declaration to C source |
Date: |
Tue, 18 Feb 2020 09:55:59 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 2/17/20 12:45 PM, Philippe Mathieu-Daudé wrote:
> No code out of bcm2836.c uses (or requires) this declarations.
> Move it locally to the C source file.
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Luc Michel <address@hidden>
> ---
> include/hw/arm/bcm2836.h | 12 ------------
> hw/arm/bcm2836.c | 14 ++++++++++++++
> 2 files changed, 14 insertions(+), 12 deletions(-)
>
> diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h
> index 92a6544816..acc75bf553 100644
> --- a/include/hw/arm/bcm2836.h
> +++ b/include/hw/arm/bcm2836.h
> @@ -42,16 +42,4 @@ typedef struct BCM283XState {
> BCM2835PeripheralState peripherals;
> } BCM283XState;
>
> -typedef struct BCM283XInfo BCM283XInfo;
> -
> -typedef struct BCM283XClass {
> - DeviceClass parent_class;
> - const BCM283XInfo *info;
> -} BCM283XClass;
> -
> -#define BCM283X_CLASS(klass) \
> - OBJECT_CLASS_CHECK(BCM283XClass, (klass), TYPE_BCM283X)
> -#define BCM283X_GET_CLASS(obj) \
> - OBJECT_GET_CLASS(BCM283XClass, (obj), TYPE_BCM283X)
> -
> #endif /* BCM2836_H */
> diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c
> index 38e2941bab..24109fef1d 100644
> --- a/hw/arm/bcm2836.c
> +++ b/hw/arm/bcm2836.c
> @@ -16,6 +16,15 @@
> #include "hw/arm/raspi_platform.h"
> #include "hw/sysbus.h"
>
> +typedef struct BCM283XInfo BCM283XInfo;
> +
> +typedef struct BCM283XClass {
> + /*< private >*/
> + DeviceClass parent_class;
> + /*< public >*/
> + const BCM283XInfo *info;
> +} BCM283XClass;
> +
> struct BCM283XInfo {
> const char *name;
> const char *cpu_type;
> @@ -24,6 +33,11 @@ struct BCM283XInfo {
> int clusterid;
> };
>
> +#define BCM283X_CLASS(klass) \
> + OBJECT_CLASS_CHECK(BCM283XClass, (klass), TYPE_BCM283X)
> +#define BCM283X_GET_CLASS(obj) \
> + OBJECT_GET_CLASS(BCM283XClass, (obj), TYPE_BCM283X)
> +
> static const BCM283XInfo bcm283x_socs[] = {
> {
> .name = TYPE_BCM2836,
>
- Re: [PATCH v2 01/13] hw/arm/raspi: Remove ignore_memory_transaction_failures on the raspi2, (continued)
- [PATCH v2 02/13] hw/arm/raspi: Avoid using TypeInfo::class_data pointer, Philippe Mathieu-Daudé, 2020/02/17
- [PATCH v2 03/13] hw/arm/raspi: Use more specific machine names, Philippe Mathieu-Daudé, 2020/02/17
- [PATCH v2 04/13] hw/arm/raspi: Introduce RaspiProcessorId enum, Philippe Mathieu-Daudé, 2020/02/17
- [PATCH v2 05/13] hw/arm/raspi: Remove use of the 'version' value in the board code, Philippe Mathieu-Daudé, 2020/02/17
- [PATCH v2 06/13] hw/arm/bcm2836: Restrict BCM283XClass declaration to C source, Philippe Mathieu-Daudé, 2020/02/17
- Re: [PATCH v2 06/13] hw/arm/bcm2836: Restrict BCM283XClass declaration to C source,
Luc Michel <=
- [PATCH v2 08/13] hw/arm/bcm2836: Introduce BCM283XClass::core_count, Philippe Mathieu-Daudé, 2020/02/17
- [PATCH v2 09/13] hw/arm/bcm2836: Only provide "enabled-cpus" property to multicore SoCs, Philippe Mathieu-Daudé, 2020/02/17
- [PATCH v2 07/13] hw/arm/bcm2836: QOM'ify more by adding class_init() to each SoC type, Philippe Mathieu-Daudé, 2020/02/17
- [PATCH v2 10/13] hw/arm/bcm2836: Split out common realize() code, Philippe Mathieu-Daudé, 2020/02/17