From: Masahiro Yamada <masahiroy@kernel.org>
To: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
"Daniel P . Berrange" <berrange@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Subject: [PATCH] qom/object: pass (Object *) to object_initialize_with_type()
Date: Wed, 13 May 2020 02:31:04 +0900 [thread overview]
Message-ID: <20200512173104.2293073-1-masahiroy@kernel.org> (raw)
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
next reply other threads:[~2020-05-12 17:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-12 17:31 Masahiro Yamada [this message]
2020-05-12 18:17 ` [PATCH] qom/object: pass (Object *) to object_initialize_with_type() Philippe Mathieu-Daudé
2020-05-12 18:32 ` Masahiro Yamada
2020-05-21 14:46 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200512173104.2293073-1-masahiroy@kernel.org \
--to=masahiroy@kernel.org \
--cc=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).