diff mbox series

[3/4] hw/qdev-properties: Constify Property* in PropertyInfo::create() handler

Message ID 20230203101224.25796-4-philmd@linaro.org (mailing list archive)
State New, archived
Headers show
Series hw/qdev-properties: Constify Property* in DeviceClass | expand

Commit Message

Philippe Mathieu-Daudé Feb. 3, 2023, 10:12 a.m. UTC
The pointed Property structure is accessed read-only.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/core/qdev-properties.c    | 2 +-
 include/hw/qdev-properties.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 858c33830c..baf9a91b29 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -840,7 +840,7 @@  const PropertyInfo qdev_prop_size = {
 /* --- object link property --- */
 
 static ObjectProperty *create_link_property(ObjectClass *oc, const char *name,
-                                            Property *prop)
+                                            const Property *prop)
 {
     return object_class_property_add_link(oc, name, prop->link_type,
                                           prop->offset,
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index 39959c3432..21f399e9a3 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -37,7 +37,7 @@  struct PropertyInfo {
     int (*print)(Object *obj, const Property *prop, char *dest, size_t len);
     void (*set_default_value)(ObjectProperty *op, const Property *prop);
     ObjectProperty *(*create)(ObjectClass *oc, const char *name,
-                              Property *prop);
+                              const Property *prop);
     ObjectPropertyAccessor *get;
     ObjectPropertyAccessor *set;
     ObjectPropertyRelease *release;