All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	qemu-devel@nongnu.org,
	"Aleksandar Markovic" <aleksandar.qemu.devel@gmail.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>
Subject: fixup! qom: Simplify and merge pointer property getters/setters
Date: Fri, 9 Oct 2020 16:09:47 -0400	[thread overview]
Message-ID: <20201009200947.GG7303@habkost.net> (raw)
In-Reply-To: <3f01d20b-b172-5fb0-6659-8aafad2ed4be@redhat.com>

On Fri, Oct 09, 2020 at 03:02:58PM -0500, Eric Blake wrote:
> On 10/9/20 2:15 PM, Eduardo Habkost wrote:
> > Both the property getter and setter for pointer properties can
> > simply call the visitor functions directly, instead of making
> > extra copies and requiring additional logic.
> > 
> > Remove the extra copying logic, and merge the getter and setter
> > functions in object_visit_uint*_ptr() accessors.
> > 
> > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> > ---
> >  qom/object.c | 114 ++++++++++-----------------------------------------
> >  1 file changed, 22 insertions(+), 92 deletions(-)
> > 
> > diff --git a/qom/object.c b/qom/object.c
> > index 6b4dfc279a..3b343fd118 100644
> > --- a/qom/object.c
> > +++ b/qom/object.c
> > @@ -2496,119 +2496,57 @@ static void *pointer_property_get_ptr(Object *obj, PointerProperty *prop)
> >      }
> >  }
> >  
> > -static void property_get_uint8_ptr(Object *obj, Visitor *v, const char *name,
> > +static void property_visit_uint8_ptr(Object *obj, Visitor *v, const char *name,
> >                                     void *opaque, Error **errp)
> 
> Indentation is now off.  Several instances.

Oops.  Fixup applied locally.  Thanks!

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
diff --git a/qom/object.c b/qom/object.c
index 3b343fd118..9d3710dec5 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -2497,7 +2497,7 @@ static void *pointer_property_get_ptr(Object *obj, PointerProperty *prop)
 }
 
 static void property_visit_uint8_ptr(Object *obj, Visitor *v, const char *name,
-                                   void *opaque, Error **errp)
+                                     void *opaque, Error **errp)
 {
     PointerProperty *prop = opaque;
     uint8_t *field = pointer_property_get_ptr(obj, prop);
@@ -2505,7 +2505,7 @@ static void property_visit_uint8_ptr(Object *obj, Visitor *v, const char *name,
 }
 
 static void property_visit_uint16_ptr(Object *obj, Visitor *v, const char *name,
-                                    void *opaque, Error **errp)
+                                      void *opaque, Error **errp)
 {
     PointerProperty *prop = opaque;
     uint16_t *field = pointer_property_get_ptr(obj, prop);
@@ -2513,7 +2513,7 @@ static void property_visit_uint16_ptr(Object *obj, Visitor *v, const char *name,
 }
 
 static void property_visit_uint32_ptr(Object *obj, Visitor *v, const char *name,
-                                    void *opaque, Error **errp)
+                                      void *opaque, Error **errp)
 {
     PointerProperty *prop = opaque;
     uint32_t *field = pointer_property_get_ptr(obj, prop);
@@ -2521,7 +2521,7 @@ static void property_visit_uint32_ptr(Object *obj, Visitor *v, const char *name,
 }
 
 static void property_visit_uint64_ptr(Object *obj, Visitor *v, const char *name,
-                                    void *opaque, Error **errp)
+                                      void *opaque, Error **errp)
 {
     PointerProperty *prop = opaque;
     uint64_t *field = pointer_property_get_ptr(obj, prop);


-- 
Eduardo



  reply	other threads:[~2020-10-09 20:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 19:15 [PATCH 0/3] qom: Simplify pointer property getters/setters Eduardo Habkost
2020-10-09 19:15 ` [PATCH 1/3] acpi: Don't pass const pointers to object_property_add_uint*_ptr() Eduardo Habkost
2020-10-09 19:15 ` [PATCH 2/3] qom: Make object_property_add_uint*_ptr() get non-const pointers Eduardo Habkost
2020-10-09 19:15 ` [PATCH 3/3] qom: Simplify and merge pointer property getters/setters Eduardo Habkost
2020-10-09 20:02   ` Eric Blake
2020-10-09 20:09     ` Eduardo Habkost [this message]
2020-10-21 13:09 ` [PATCH 0/3] qom: Simplify " Igor Mammedov

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=20201009200947.GG7303@habkost.net \
    --to=ehabkost@redhat.com \
    --cc=aleksandar.qemu.devel@gmail.com \
    --cc=armbru@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=imammedo@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.