qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Masahiro Yamada <masahiroy@kernel.org>,
	qemu-devel@nongnu.org,
	"Daniel P . Berrange" <berrange@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [PATCH] qom/object: pass (Object *) to object_initialize_with_type()
Date: Thu, 21 May 2020 16:46:26 +0200	[thread overview]
Message-ID: <ae82206c-e147-1448-ea91-0517c1157bf1@redhat.com> (raw)
In-Reply-To: <20200512173104.2293073-1-masahiroy@kernel.org>

On 12/05/20 19:31, Masahiro Yamada wrote:
> 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));
> 

Queued, thanks.

Paolo



      parent reply	other threads:[~2020-05-21 14:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=ae82206c-e147-1448-ea91-0517c1157bf1@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=masahiroy@kernel.org \
    --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).