From patchwork Sun Jun 5 07:42:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 9155133 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 36D8060221 for ; Sun, 5 Jun 2016 07:52:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2595127B13 for ; Sun, 5 Jun 2016 07:52:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1739528210; Sun, 5 Jun 2016 07:52:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 665D027B13 for ; Sun, 5 Jun 2016 07:52:17 +0000 (UTC) Received: from localhost ([::1]:35815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9Sr2-0001NN-HS for patchwork-qemu-devel@patchwork.kernel.org; Sun, 05 Jun 2016 03:52:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9SqP-0001Dw-6i for qemu-devel@nongnu.org; Sun, 05 Jun 2016 03:51:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9SqJ-0005XN-WC for qemu-devel@nongnu.org; Sun, 05 Jun 2016 03:51:36 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:42012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9SqJ-0005Ww-Jl; Sun, 05 Jun 2016 03:51:31 -0400 Received: from tsrv.tls.msk.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 53057408D7; Sun, 5 Jun 2016 10:51:26 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.tls.msk.ru (Postfix) with SMTP id DE912B40; Sun, 5 Jun 2016 10:43:40 +0300 (MSK) Received: (nullmailer pid 1130 invoked by uid 1000); Sun, 05 Jun 2016 07:43:32 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 5 Jun 2016 10:42:57 +0300 Message-Id: <1682a0efa4a8164f212c1be4d40b1d8829214263.1465112552.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 20/52] qdev: Clean up around properties X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Cao jin , Michael Tokarev Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Cao jin include: 1. remove unnecessary declaration of static function 2. fix inconsistency between comment and function name, and typo OOM->QOM 2. update comments of functions, use uniform format(GTK-Doc style) Signed-off-by: Cao jin Reviewed-by: Markus Armbruster Signed-off-by: Michael Tokarev --- hw/core/qdev.c | 30 +++++++++++++++++++----------- include/hw/qdev-properties.h | 10 ++++++++-- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 853162b..0a05a52 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -58,9 +58,6 @@ const char *qdev_fw_name(DeviceState *dev) return object_get_typename(OBJECT(dev)); } -static void qdev_property_add_legacy(DeviceState *dev, Property *prop, - Error **errp); - static void bus_remove_child(BusState *bus, DeviceState *child) { BusChild *kid; @@ -733,13 +730,20 @@ static void qdev_get_legacy_property(Object *obj, Visitor *v, } /** - * @qdev_add_legacy_property - adds a legacy property + * qdev_property_add_legacy: + * @dev: Device to add the property to. + * @prop: The qdev property definition. + * @errp: location to store error information. + * + * Add a legacy QOM property to @dev for qdev property @prop. + * On error, store error in @errp. * - * Do not use this is new code! Properties added through this interface will - * be given names and types in the "legacy" namespace. + * Legacy properties are string versions of QOM properties. The format of + * the string depends on the property type. Legacy properties are only + * needed for "info qtree". * - * Legacy properties are string versions of other OOM properties. The format - * of the string depends on the property type. + * Do not use this is new code! QOM Properties added through this interface + * will be given names in the "legacy" namespace. */ static void qdev_property_add_legacy(DeviceState *dev, Property *prop, Error **errp) @@ -762,10 +766,14 @@ static void qdev_property_add_legacy(DeviceState *dev, Property *prop, } /** - * @qdev_property_add_static - add a @Property to a device. + * qdev_property_add_static: + * @dev: Device to add the property to. + * @prop: The qdev property definition. + * @errp: location to store error information. * - * Static properties access data in a struct. The actual type of the - * property and the field depends on the property type. + * Add a static QOM property to @dev for qdev property @prop. + * On error, store error in @errp. Static properties access data in a struct. + * The type of the QOM property is derived from prop->info. */ void qdev_property_add_static(DeviceState *dev, Property *prop, Error **errp) diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 0586cac..034b75a 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -197,8 +197,14 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev, Property *prop, const char *value); /** - * @qdev_property_add_static - add a @Property to a device referencing a - * field in a struct. + * qdev_property_add_static: + * @dev: Device to add the property to. + * @prop: The qdev property definition. + * @errp: location to store error information. + * + * Add a static QOM property to @dev for qdev property @prop. + * On error, store error in @errp. Static properties access data in a struct. + * The type of the QOM property is derived from prop->info. */ void qdev_property_add_static(DeviceState *dev, Property *prop, Error **errp);