[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 17/19] qom: Delete field_prop_set_default_value_*int()
From: |
Eduardo Habkost |
Subject: |
[PATCH v3 17/19] qom: Delete field_prop_set_default_value_*int() |
Date: |
Mon, 23 Nov 2020 14:48:16 -0500 |
The field_prop_set_default_value_*int() functions can be
completely replaced by object_propert_set_default(),
we don't need them anymore.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
This is a new patch in v3 of this series.
In v2 of the series, equivalent changes were part of "qom: Use
qlit to represent property defaults".
---
include/qom/field-property-internal.h | 6 ------
hw/core/qdev-properties-system.c | 2 --
qom/property-types.c | 25 -------------------------
3 files changed, 33 deletions(-)
diff --git a/include/qom/field-property-internal.h
b/include/qom/field-property-internal.h
index 7ed0d8d160..4bcf5b45f3 100644
--- a/include/qom/field-property-internal.h
+++ b/include/qom/field-property-internal.h
@@ -16,12 +16,6 @@ void field_prop_set_enum(Object *obj, Visitor *v, const char
*name,
void field_prop_set_default_value_enum(ObjectProperty *op,
const Property *prop,
const QObject *defval);
-void field_prop_set_default_value_int(ObjectProperty *op,
- const Property *prop,
- const QObject *defval);
-void field_prop_set_default_value_uint(ObjectProperty *op,
- const Property *prop,
- const QObject *defval);
void field_prop_get_int32(Object *obj, Visitor *v, const char *name,
void *opaque, Error **errp);
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index 117c540254..b2df955f2a 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -571,7 +571,6 @@ const PropertyInfo qdev_prop_blocksize = {
" and " MAX_BLOCK_SIZE_STR,
.get = field_prop_get_size32,
.set = set_blocksize,
- .set_default_value = field_prop_set_default_value_uint,
};
/* --- Block device error handling policy --- */
@@ -769,7 +768,6 @@ const PropertyInfo qdev_prop_pci_devfn = {
.print = print_pci_devfn,
.get = field_prop_get_int32,
.set = set_pci_devfn,
- .set_default_value = field_prop_set_default_value_int,
};
/* --- pci host address --- */
diff --git a/qom/property-types.c b/qom/property-types.c
index 0fc24b3687..399e36c29e 100644
--- a/qom/property-types.c
+++ b/qom/property-types.c
@@ -195,27 +195,10 @@ static void set_uint8(Object *obj, Visitor *v, const char
*name, void *opaque,
visit_type_uint8(v, name, ptr, errp);
}
-void field_prop_set_default_value_int(ObjectProperty *op,
- const Property *prop,
- const QObject *defval)
-{
- QNum *qn = qobject_to(QNum, defval);
- object_property_set_default_int(op, qnum_get_int(qn));
-}
-
-void field_prop_set_default_value_uint(ObjectProperty *op,
- const Property *prop,
- const QObject *defval)
-{
- QNum *qn = qobject_to(QNum, defval);
- object_property_set_default_uint(op, qnum_get_uint(qn));
-}
-
const PropertyInfo prop_info_uint8 = {
.name = "uint8",
.get = get_uint8,
.set = set_uint8,
- .set_default_value = field_prop_set_default_value_uint,
};
/* --- 16bit integer --- */
@@ -242,7 +225,6 @@ const PropertyInfo prop_info_uint16 = {
.name = "uint16",
.get = get_uint16,
.set = set_uint16,
- .set_default_value = field_prop_set_default_value_uint,
};
/* --- 32bit integer --- */
@@ -287,14 +269,12 @@ const PropertyInfo prop_info_uint32 = {
.name = "uint32",
.get = get_uint32,
.set = set_uint32,
- .set_default_value = field_prop_set_default_value_uint,
};
const PropertyInfo prop_info_int32 = {
.name = "int32",
.get = field_prop_get_int32,
.set = set_int32,
- .set_default_value = field_prop_set_default_value_int,
};
/* --- 64bit integer --- */
@@ -339,14 +319,12 @@ const PropertyInfo prop_info_uint64 = {
.name = "uint64",
.get = get_uint64,
.set = set_uint64,
- .set_default_value = field_prop_set_default_value_uint,
};
const PropertyInfo prop_info_int64 = {
.name = "int64",
.get = get_int64,
.set = set_int64,
- .set_default_value = field_prop_set_default_value_int,
};
/* --- string --- */
@@ -441,7 +419,6 @@ const PropertyInfo prop_info_size32 = {
.name = "size",
.get = field_prop_get_size32,
.set = set_size32,
- .set_default_value = field_prop_set_default_value_uint,
};
/* --- support for array properties --- */
@@ -505,7 +482,6 @@ const PropertyInfo prop_info_arraylen = {
.name = "uint32",
.get = get_uint32,
.set = set_prop_arraylen,
- .set_default_value = field_prop_set_default_value_uint,
};
/* --- 64bit unsigned int 'size' type --- */
@@ -532,7 +508,6 @@ const PropertyInfo prop_info_size = {
.name = "size",
.get = get_size,
.set = set_size,
- .set_default_value = field_prop_set_default_value_uint,
};
/* --- object link property --- */
--
2.28.0
- Re: [PATCH v3 10/19] qlit: Support all types of QNums, (continued)
- [PATCH v3 09/19] qlit: Add more test literals to qlit_equal_qobject() test case, Eduardo Habkost, 2020/11/23
- [PATCH v3 08/19] qlit: Move qlit_equal_qobject() reference values to array, Eduardo Habkost, 2020/11/23
- [PATCH v3 11/19] qom: field_prop_set_default_value() helper, Eduardo Habkost, 2020/11/23
- [PATCH v3 12/19] qom: Replace defval value in Property with QLitObject, Eduardo Habkost, 2020/11/23
- [PATCH v3 13/19] qom: Fix documentation of UUID property type, Eduardo Habkost, 2020/11/23
- [PATCH v3 15/19] qom: Make object_property_set_default() public, Eduardo Habkost, 2020/11/23
- [PATCH v3 16/19] qom: Make PropertyInfo.set_default_value optional, Eduardo Habkost, 2020/11/23
- [PATCH v3 17/19] qom: Delete field_prop_set_default_value_*int(),
Eduardo Habkost <=
- [PATCH v3 14/19] qom: Don't ignore defval on UUID property, Eduardo Habkost, 2020/11/23
- [PATCH v3 19/19] qom: Delete set_default_value_bool(), Eduardo Habkost, 2020/11/23
- [PATCH v3 18/19] qom: Delete set_default_uuid(), Eduardo Habkost, 2020/11/23