diff mbox series

[2/4] hda-audio: Set instance_size at base class

Message ID 20200826171005.4055015-3-ehabkost@redhat.com
State New
Headers show
Series None | expand

Commit Message

Eduardo Habkost Aug. 26, 2020, 5:10 p.m. UTC
Setting instance_size correctly at the base class will help us
avoid mistakes when declaring new subclasses.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
---
 hw/audio/hda-codec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Philippe Mathieu-Daudé Aug. 31, 2020, 7:44 p.m. UTC | #1
Le mer. 26 août 2020 19:12, Eduardo Habkost <ehabkost@redhat.com> a écrit :

> Setting instance_size correctly at the base class will help us
> avoid mistakes when declaring new subclasses.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

---
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: qemu-devel@nongnu.org
> ---
>  hw/audio/hda-codec.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
> index cbd92b72f2..2d16448181 100644
> --- a/hw/audio/hda-codec.c
> +++ b/hw/audio/hda-codec.c
> @@ -898,6 +898,7 @@ static void hda_audio_base_class_init(ObjectClass
> *klass, void *data)
>  static const TypeInfo hda_audio_info = {
>      .name          = TYPE_HDA_AUDIO,
>      .parent        = TYPE_HDA_CODEC_DEVICE,
> +    .instance_size = sizeof(HDAAudioState),
>      .class_init    = hda_audio_base_class_init,
>      .abstract      = true,
>  };
> @@ -914,7 +915,6 @@ static void hda_audio_output_class_init(ObjectClass
> *klass, void *data)
>  static const TypeInfo hda_audio_output_info = {
>      .name          = "hda-output",
>      .parent        = TYPE_HDA_AUDIO,
> -    .instance_size = sizeof(HDAAudioState),
>      .class_init    = hda_audio_output_class_init,
>  };
>
> @@ -930,7 +930,6 @@ static void hda_audio_duplex_class_init(ObjectClass
> *klass, void *data)
>  static const TypeInfo hda_audio_duplex_info = {
>      .name          = "hda-duplex",
>      .parent        = TYPE_HDA_AUDIO,
> -    .instance_size = sizeof(HDAAudioState),
>      .class_init    = hda_audio_duplex_class_init,
>  };
>
> @@ -946,7 +945,6 @@ static void hda_audio_micro_class_init(ObjectClass
> *klass, void *data)
>  static const TypeInfo hda_audio_micro_info = {
>      .name          = "hda-micro",
>      .parent        = TYPE_HDA_AUDIO,
> -    .instance_size = sizeof(HDAAudioState),
>      .class_init    = hda_audio_micro_class_init,
>  };
>
> --
> 2.26.2
>
>
>
<div dir="auto"><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 26 août 2020 19:12, Eduardo Habkost &lt;<a href="mailto:ehabkost@redhat.com">ehabkost@redhat.com</a>&gt; a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Setting instance_size correctly at the base class will help us<br>
avoid mistakes when declaring new subclasses.<br>
<br>
Signed-off-by: Eduardo Habkost &lt;<a href="mailto:ehabkost@redhat.com" target="_blank" rel="noreferrer">ehabkost@redhat.com</a>&gt;<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><span style="font-family:sans-serif;font-size:13.696px">Reviewed-by: Philippe Mathieu-Daudé &lt;</span><a href="mailto:f4bug@amsat.org" style="text-decoration:none;color:rgb(66,133,244);font-family:sans-serif;font-size:13.696px">f4bug@amsat.org</a><span style="font-family:sans-serif;font-size:13.696px">&gt;</span><br></div><div dir="auto"><span style="font-family:sans-serif;font-size:13.696px"><br></span></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
Cc: Gerd Hoffmann &lt;<a href="mailto:kraxel@redhat.com" target="_blank" rel="noreferrer">kraxel@redhat.com</a>&gt;<br>
Cc: <a href="mailto:qemu-devel@nongnu.org" target="_blank" rel="noreferrer">qemu-devel@nongnu.org</a><br>
---<br>
 hw/audio/hda-codec.c | 4 +---<br>
 1 file changed, 1 insertion(+), 3 deletions(-)<br>
<br>
diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c<br>
index cbd92b72f2..2d16448181 100644<br>
--- a/hw/audio/hda-codec.c<br>
+++ b/hw/audio/hda-codec.c<br>
@@ -898,6 +898,7 @@ static void hda_audio_base_class_init(ObjectClass *klass, void *data)<br>
 static const TypeInfo hda_audio_info = {<br>
     .name          = TYPE_HDA_AUDIO,<br>
     .parent        = TYPE_HDA_CODEC_DEVICE,<br>
+    .instance_size = sizeof(HDAAudioState),<br>
     .class_init    = hda_audio_base_class_init,<br>
     .abstract      = true,<br>
 };<br>
@@ -914,7 +915,6 @@ static void hda_audio_output_class_init(ObjectClass *klass, void *data)<br>
 static const TypeInfo hda_audio_output_info = {<br>
     .name          = &quot;hda-output&quot;,<br>
     .parent        = TYPE_HDA_AUDIO,<br>
-    .instance_size = sizeof(HDAAudioState),<br>
     .class_init    = hda_audio_output_class_init,<br>
 };<br>
<br>
@@ -930,7 +930,6 @@ static void hda_audio_duplex_class_init(ObjectClass *klass, void *data)<br>
 static const TypeInfo hda_audio_duplex_info = {<br>
     .name          = &quot;hda-duplex&quot;,<br>
     .parent        = TYPE_HDA_AUDIO,<br>
-    .instance_size = sizeof(HDAAudioState),<br>
     .class_init    = hda_audio_duplex_class_init,<br>
 };<br>
<br>
@@ -946,7 +945,6 @@ static void hda_audio_micro_class_init(ObjectClass *klass, void *data)<br>
 static const TypeInfo hda_audio_micro_info = {<br>
     .name          = &quot;hda-micro&quot;,<br>
     .parent        = TYPE_HDA_AUDIO,<br>
-    .instance_size = sizeof(HDAAudioState),<br>
     .class_init    = hda_audio_micro_class_init,<br>
 };<br>
<br>
-- <br>
2.26.2<br>
<br>
<br>
</blockquote></div></div></div>
diff mbox series

Patch

diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
index cbd92b72f2..2d16448181 100644
--- a/hw/audio/hda-codec.c
+++ b/hw/audio/hda-codec.c
@@ -898,6 +898,7 @@  static void hda_audio_base_class_init(ObjectClass *klass, void *data)
 static const TypeInfo hda_audio_info = {
     .name          = TYPE_HDA_AUDIO,
     .parent        = TYPE_HDA_CODEC_DEVICE,
+    .instance_size = sizeof(HDAAudioState),
     .class_init    = hda_audio_base_class_init,
     .abstract      = true,
 };
@@ -914,7 +915,6 @@  static void hda_audio_output_class_init(ObjectClass *klass, void *data)
 static const TypeInfo hda_audio_output_info = {
     .name          = "hda-output",
     .parent        = TYPE_HDA_AUDIO,
-    .instance_size = sizeof(HDAAudioState),
     .class_init    = hda_audio_output_class_init,
 };
 
@@ -930,7 +930,6 @@  static void hda_audio_duplex_class_init(ObjectClass *klass, void *data)
 static const TypeInfo hda_audio_duplex_info = {
     .name          = "hda-duplex",
     .parent        = TYPE_HDA_AUDIO,
-    .instance_size = sizeof(HDAAudioState),
     .class_init    = hda_audio_duplex_class_init,
 };
 
@@ -946,7 +945,6 @@  static void hda_audio_micro_class_init(ObjectClass *klass, void *data)
 static const TypeInfo hda_audio_micro_info = {
     .name          = "hda-micro",
     .parent        = TYPE_HDA_AUDIO,
-    .instance_size = sizeof(HDAAudioState),
     .class_init    = hda_audio_micro_class_init,
 };