From patchwork Tue Feb 9 11:37:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 8260531 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0C8E09F38B for ; Tue, 9 Feb 2016 11:50:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4BF852012E for ; Tue, 9 Feb 2016 11:50:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5F80920114 for ; Tue, 9 Feb 2016 11:50:28 +0000 (UTC) Received: from localhost ([::1]:54686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT6oN-0004fn-Pp for patchwork-qemu-devel@patchwork.kernel.org; Tue, 09 Feb 2016 06:50:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT6cY-0007uc-2p for qemu-devel@nongnu.org; Tue, 09 Feb 2016 06:38:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aT6cW-00032b-3e for qemu-devel@nongnu.org; Tue, 09 Feb 2016 06:38:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55064) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT6cV-000326-SX for qemu-devel@nongnu.org; Tue, 09 Feb 2016 06:38:12 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 816C88E3E3 for ; Tue, 9 Feb 2016 11:38:11 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-34.ams2.redhat.com [10.36.116.34]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u19Bc8kh030730 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 9 Feb 2016 06:38:09 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7D6A93006AE1; Tue, 9 Feb 2016 12:38:04 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 9 Feb 2016 12:37:53 +0100 Message-Id: <1455017883-25867-22-git-send-email-armbru@redhat.com> In-Reply-To: <1455017883-25867-1-git-send-email-armbru@redhat.com> References: <1455017883-25867-1-git-send-email-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 21/31] qom: Use typedef for Visitor X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Blake No need to repeat 'struct Visitor' when we already have it in typedefs.h. Omitting the redundant 'struct' also makes a later patch easier to search for all object property callbacks that are associated with a Visitor. Signed-off-by: Eric Blake Reviewed-by: Marc-André Lureau Message-Id: <1454075341-13658-18-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster --- hw/misc/edu.c | 4 ++-- hw/virtio/virtio-balloon.c | 6 +++--- include/qom/object.h | 9 ++++----- qom/object.c | 4 ++-- target-i386/cpu.c | 4 ++-- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/hw/misc/edu.c b/hw/misc/edu.c index 2639c64..65e8f20 100644 --- a/hw/misc/edu.c +++ b/hw/misc/edu.c @@ -363,8 +363,8 @@ static void pci_edu_uninit(PCIDevice *pdev) timer_del(&edu->dma_timer); } -static void edu_obj_uint64(Object *obj, struct Visitor *v, void *opaque, - const char *name, Error **errp) +static void edu_obj_uint64(Object *obj, Visitor *v, void *opaque, + const char *name, Error **errp) { uint64_t *val = opaque; diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 06912bb..7d05d3f 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -113,7 +113,7 @@ static void balloon_stats_poll_cb(void *opaque) s->stats_vq_elem = NULL; } -static void balloon_stats_get_all(Object *obj, struct Visitor *v, +static void balloon_stats_get_all(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { Error *err = NULL; @@ -151,7 +151,7 @@ out: error_propagate(errp, err); } -static void balloon_stats_get_poll_interval(Object *obj, struct Visitor *v, +static void balloon_stats_get_poll_interval(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { @@ -159,7 +159,7 @@ static void balloon_stats_get_poll_interval(Object *obj, struct Visitor *v, visit_type_int(v, &s->stats_poll_interval, name, errp); } -static void balloon_stats_set_poll_interval(Object *obj, struct Visitor *v, +static void balloon_stats_set_poll_interval(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { diff --git a/include/qom/object.h b/include/qom/object.h index d0dafe9..3e7e99d 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -18,10 +18,9 @@ #include #include #include "qemu/queue.h" +#include "qemu/typedefs.h" #include "qapi/error.h" -struct Visitor; - struct TypeImpl; typedef struct TypeImpl *Type; @@ -298,7 +297,7 @@ typedef struct InterfaceInfo InterfaceInfo; * Called when trying to get/set a property. */ typedef void (ObjectPropertyAccessor)(Object *obj, - struct Visitor *v, + Visitor *v, void *opaque, const char *name, Error **errp); @@ -1025,7 +1024,7 @@ void object_unparent(Object *obj); * * Reads a property from a object. */ -void object_property_get(Object *obj, struct Visitor *v, const char *name, +void object_property_get(Object *obj, Visitor *v, const char *name, Error **errp); /** @@ -1161,7 +1160,7 @@ void object_property_get_uint16List(Object *obj, const char *name, * * Writes a property to a object. */ -void object_property_set(Object *obj, struct Visitor *v, const char *name, +void object_property_set(Object *obj, Visitor *v, const char *name, Error **errp); /** diff --git a/qom/object.c b/qom/object.c index 5904081..3506a98 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2185,7 +2185,7 @@ typedef struct { char *target_name; } AliasProperty; -static void property_get_alias(Object *obj, struct Visitor *v, void *opaque, +static void property_get_alias(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { AliasProperty *prop = opaque; @@ -2193,7 +2193,7 @@ static void property_get_alias(Object *obj, struct Visitor *v, void *opaque, object_property_get(prop->target_obj, v, prop->target_name, errp); } -static void property_set_alias(Object *obj, struct Visitor *v, void *opaque, +static void property_set_alias(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { AliasProperty *prop = opaque; diff --git a/target-i386/cpu.c b/target-i386/cpu.c index b255644..60bfa80 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -2945,7 +2945,7 @@ typedef struct BitProperty { } BitProperty; static void x86_cpu_get_bit_prop(Object *obj, - struct Visitor *v, + Visitor *v, void *opaque, const char *name, Error **errp) @@ -2956,7 +2956,7 @@ static void x86_cpu_get_bit_prop(Object *obj, } static void x86_cpu_set_bit_prop(Object *obj, - struct Visitor *v, + Visitor *v, void *opaque, const char *name, Error **errp)