From patchwork Thu Mar 24 10:14:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cao jin X-Patchwork-Id: 8659351 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 AB8BA9F3D1 for ; Thu, 24 Mar 2016 10:12:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C366201C8 for ; Thu, 24 Mar 2016 10:12:48 +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 1BBCC200E6 for ; Thu, 24 Mar 2016 10:12:47 +0000 (UTC) Received: from localhost ([::1]:48955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj2Fy-0000rr-Fn for patchwork-qemu-devel@patchwork.kernel.org; Thu, 24 Mar 2016 06:12:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj2Fq-0000rf-0N for qemu-devel@nongnu.org; Thu, 24 Mar 2016 06:12:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aj2Fm-0000zc-ND for qemu-devel@nongnu.org; Thu, 24 Mar 2016 06:12:37 -0400 Received: from [59.151.112.132] (port=49310 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj2Fm-0000uX-As; Thu, 24 Mar 2016 06:12:34 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="4927322" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 24 Mar 2016 18:12:14 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id D14D3408D264; Thu, 24 Mar 2016 18:12:13 +0800 (CST) Received: from G08FNSTD140223.g08.fujitsu.local (10.167.226.69) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.279.2; Thu, 24 Mar 2016 18:12:13 +0800 From: Cao jin To: Date: Thu, 24 Mar 2016 18:14:21 +0800 Message-ID: <1458814461-5387-1-git-send-email-caoj.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 X-Originating-IP: [10.167.226.69] X-yoursite-MailScanner-ID: D14D3408D264.AAAC0 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: caoj.fnst@cn.fujitsu.com X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 59.151.112.132 Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com, armbru@redhat.com, peter.maydell@linaro.org Subject: [Qemu-devel] [PATCH] qdev property: cleanup 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 include: 1. remove unnecessary declaration of static function 2. fix inconsistency between comment and function name, and typo OOM->QOM 2. update comment of function Signed-off-by: Cao jin --- A question about legacy property: I don`t see legacy property is really used in the code, so, why still add legacy property to object? since it has no maintainer, so the cc list is by intuition... hw/core/qdev.c | 14 ++++++-------- include/hw/qdev-properties.h | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index db41aa1..743b71b 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; @@ -908,12 +905,12 @@ static void qdev_get_legacy_property(Object *obj, Visitor *v, } /** - * @qdev_add_legacy_property - adds a legacy property + * @qdev_property_add_legacy - adds a legacy property * * 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 other OOM properties. The format + * Legacy properties are string versions of other QOM properties. The format * of the string depends on the property type. */ static void qdev_property_add_legacy(DeviceState *dev, Property *prop, @@ -937,10 +934,11 @@ static void qdev_property_add_legacy(DeviceState *dev, Property *prop, } /** - * @qdev_property_add_static - add a @Property to a device. + * @qdev_property_add_static + * add a QOM property to @dev via its qdev Property @prop * - * Static properties access data in a struct. The actual type of the - * property and the field depends on the property type. + * Static properties access data in a struct. The actual type of ObjectProperty + * and the struct field depends on the @qtype type. */ 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..8c4481b 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -197,8 +197,8 @@ 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 - add a ObjectProperty to @dev via its qdev + * property @prop, referencing a field in the struct. */ void qdev_property_add_static(DeviceState *dev, Property *prop, Error **errp);