[PATCH] qom/container: remove .instance_size initializer from container_info

Masahiro Yamada posted 1 patch 4 years ago
Test checkpatch passed
Test FreeBSD passed
Test docker-mingw@fedora passed
Test asan passed
Test docker-quick@centos7 passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200513033600.2709646-1-masahiroy@kernel.org
Maintainers: "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
qom/container.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] qom/container: remove .instance_size initializer from container_info
Posted by Masahiro Yamada 4 years ago
You can omit .instance_size if it is the same as that of the parent.

    .class_size = sizeof(ObjectClass)

... is omitted here, so removing .instance_size is more consistent.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 qom/container.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/qom/container.c b/qom/container.c
index f6ccaf7ea7..4c030d6dda 100644
--- a/qom/container.c
+++ b/qom/container.c
@@ -16,7 +16,6 @@
 
 static const TypeInfo container_info = {
     .name          = "container",
-    .instance_size = sizeof(Object),
     .parent        = TYPE_OBJECT,
 };
 
-- 
2.25.1


Re: [PATCH] qom/container: remove .instance_size initializer from container_info
Posted by Paolo Bonzini 3 years, 12 months ago
On 13/05/20 05:36, Masahiro Yamada wrote:
> You can omit .instance_size if it is the same as that of the parent.
> 
>     .class_size = sizeof(ObjectClass)
> 
> ... is omitted here, so removing .instance_size is more consistent.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  qom/container.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/qom/container.c b/qom/container.c
> index f6ccaf7ea7..4c030d6dda 100644
> --- a/qom/container.c
> +++ b/qom/container.c
> @@ -16,7 +16,6 @@
>  
>  static const TypeInfo container_info = {
>      .name          = "container",
> -    .instance_size = sizeof(Object),
>      .parent        = TYPE_OBJECT,
>  };
>  
> 

Queued, thanks.

Paolo