qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/isa/isa-superio: Set abstract TYPE_ISA_SUPERIO instance s


From: Eduardo Habkost
Subject: Re: [PATCH] hw/isa/isa-superio: Set abstract TYPE_ISA_SUPERIO instance size
Date: Fri, 21 Aug 2020 18:11:41 -0400

On Fri, Aug 21, 2020 at 07:38:31PM +0200, Philippe Mathieu-Daudé wrote:
> Instead of setting the instance size on each implementations,
> set it on the abstract parent, so we are sure no implementation
> will forget to set it.
> 
> Reported-by: Eduardo Habkost <ehabkost@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Thanks!

The changes look good, but while we are at it we could also clear
class_size at smc37c669_type_info and via_superio_info.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
diff --git a/hw/isa/smc37c669-superio.c b/hw/isa/smc37c669-superio.c
index a988c55330..2dab9d90bf 100644
--- a/hw/isa/smc37c669-superio.c
+++ b/hw/isa/smc37c669-superio.c
@@ -103,7 +103,6 @@ static void smc37c669_class_init(ObjectClass *klass, void 
*data)
 static const TypeInfo smc37c669_type_info = {
     .name          = TYPE_SMC37C669_SUPERIO,
     .parent        = TYPE_ISA_SUPERIO,
-    .class_size    = sizeof(ISASuperIOClass),
     .class_init    = smc37c669_class_init,
 };
 TYPE_INFO(smc37c669_type_info)
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index 4a9f8954a9..4fd3550cbb 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -542,7 +542,6 @@ static void vt82c686b_superio_class_init(ObjectClass 
*klass, void *data)
 static const TypeInfo via_superio_info = {
     .name          = TYPE_VT82C686B_SUPERIO,
     .parent        = TYPE_ISA_SUPERIO,
-    .class_size    = sizeof(ISASuperIOClass),
     .class_init    = vt82c686b_superio_class_init,
 };
 TYPE_INFO(via_superio_info)

> ---
> See:
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg731954.html
> ---
>  hw/isa/isa-superio.c       | 2 +-
>  hw/isa/smc37c669-superio.c | 1 -
>  hw/isa/vt82c686.c          | 1 -
>  3 files changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
> index e2e47d8fd99..83eb21ebb2a 100644
> --- a/hw/isa/isa-superio.c
> +++ b/hw/isa/isa-superio.c
> @@ -182,6 +182,7 @@ static const TypeInfo isa_superio_type_info = {
>      .name = TYPE_ISA_SUPERIO,
>      .parent = TYPE_ISA_DEVICE,
>      .abstract = true,
> +    .instance_size = sizeof(ISASuperIODevice),
>      .class_size = sizeof(ISASuperIOClass),
>      .class_init = isa_superio_class_init,
>  };
> @@ -200,7 +201,6 @@ static void fdc37m81x_class_init(ObjectClass *klass, void 
> *data)
>  static const TypeInfo fdc37m81x_type_info = {
>      .name          = TYPE_FDC37M81X_SUPERIO,
>      .parent        = TYPE_ISA_SUPERIO,
> -    .instance_size = sizeof(ISASuperIODevice),
>      .class_init    = fdc37m81x_class_init,
>  };
>  
> diff --git a/hw/isa/smc37c669-superio.c b/hw/isa/smc37c669-superio.c
> index 18287741cb4..9e59dc16039 100644
> --- a/hw/isa/smc37c669-superio.c
> +++ b/hw/isa/smc37c669-superio.c
> @@ -103,7 +103,6 @@ static void smc37c669_class_init(ObjectClass *klass, void 
> *data)
>  static const TypeInfo smc37c669_type_info = {
>      .name          = TYPE_SMC37C669_SUPERIO,
>      .parent        = TYPE_ISA_SUPERIO,
> -    .instance_size = sizeof(ISASuperIODevice),
>      .class_size    = sizeof(ISASuperIOClass),
>      .class_init    = smc37c669_class_init,
>  };
> diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
> index 18160ca445d..a4b84d405d0 100644
> --- a/hw/isa/vt82c686.c
> +++ b/hw/isa/vt82c686.c
> @@ -533,7 +533,6 @@ static void vt82c686b_superio_class_init(ObjectClass 
> *klass, void *data)
>  static const TypeInfo via_superio_info = {
>      .name          = TYPE_VT82C686B_SUPERIO,
>      .parent        = TYPE_ISA_SUPERIO,
> -    .instance_size = sizeof(ISASuperIODevice),
>      .class_size    = sizeof(ISASuperIOClass),
>      .class_init    = vt82c686b_superio_class_init,
>  };
> -- 
> 2.26.2
> 

-- 
Eduardo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]