qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qom/object: pass (Object *) to object_initialize_with_type()
@ 2020-05-12 17:31 Masahiro Yamada
  2020-05-12 18:17 ` Philippe Mathieu-Daudé
  2020-05-21 14:46 ` Paolo Bonzini
  0 siblings, 2 replies; 4+ messages in thread
From: Masahiro Yamada @ 2020-05-12 17:31 UTC (permalink / raw)
  To: qemu-devel, Paolo Bonzini, Daniel P . Berrange, Eduardo Habkost
  Cc: Masahiro Yamada

object_new_with_type() already passes (Object *) pointer.
Avoid casting back and forth.

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

 qom/object.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/qom/object.c b/qom/object.c
index e4085d8ae2..9d1a918e42 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -495,10 +495,8 @@ static void object_class_property_init_all(Object *obj)
     }
 }
 
-static void object_initialize_with_type(void *data, size_t size, TypeImpl *type)
+static void object_initialize_with_type(Object *obj, size_t size, TypeImpl *type)
 {
-    Object *obj = data;
-
     type_initialize(type);
 
     g_assert(type->instance_size >= sizeof(Object));
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-21 14:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-12 17:31 [PATCH] qom/object: pass (Object *) to object_initialize_with_type() Masahiro Yamada
2020-05-12 18:17 ` Philippe Mathieu-Daudé
2020-05-12 18:32   ` Masahiro Yamada
2020-05-21 14:46 ` Paolo Bonzini

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).