[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PULL 20/52] qdev: Clean up around properties
From: |
Michael Tokarev |
Subject: |
[Qemu-trivial] [PULL 20/52] qdev: Clean up around properties |
Date: |
Sun, 5 Jun 2016 10:42:57 +0300 |
From: Cao jin <address@hidden>
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 <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
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);
--
2.1.4
- [Qemu-trivial] [PULL 00/52] Trivial patches for 2016-06-05, Michael Tokarev, 2016/06/05
- [Qemu-trivial] [PULL 11/52] remove useless muldiv64(), Michael Tokarev, 2016/06/05
- [Qemu-trivial] [PULL 10/52] The only 64bit parameter of muldiv64() is the first one., Michael Tokarev, 2016/06/05
- [Qemu-trivial] [PULL 06/52] target-moxie: Remove unused struct elements, Michael Tokarev, 2016/06/05
- [Qemu-trivial] [PULL 08/52] gdbstub: set listen backlog to 1, Michael Tokarev, 2016/06/05
- [Qemu-trivial] [PULL 09/52] scripts: add muldiv64() checking coccinelle scripts, Michael Tokarev, 2016/06/05
- [Qemu-trivial] [PULL 19/52] monitor: Typo fix, Michael Tokarev, 2016/06/05
- [Qemu-trivial] [PULL 20/52] qdev: Clean up around properties,
Michael Tokarev <=
- [Qemu-trivial] [PULL 31/52] all: Remove unnecessary glib.h includes, Michael Tokarev, 2016/06/05
- [Qemu-trivial] [PULL 14/52] Fix linking relocatable objects on Sparc, Michael Tokarev, 2016/06/05
- [Qemu-trivial] [PULL 25/52] Fix configure test for PBKDF2 in nettle, Michael Tokarev, 2016/06/05
- [Qemu-trivial] [PULL 07/52] po/Makefile: call rm -f directly, Michael Tokarev, 2016/06/05
- [Qemu-trivial] [PULL 24/52] docs: Fix a couple of typos in throttle.txt, Michael Tokarev, 2016/06/05
- [Qemu-trivial] [PULL 36/52] thunk: Rename args and fields in host-target bitmask conversion code, Michael Tokarev, 2016/06/05
- [Qemu-trivial] [PULL 42/52] crypto: Use DIV_ROUND_UP, Michael Tokarev, 2016/06/05