diff mbox series

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

Message ID 20230203101224.25796-3-philmd@linaro.org
State New
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-system.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-system.c b/hw/core/qdev-properties-system.c
index d42493f630..a982de1354 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -799,7 +799,7 @@  invalid:
     g_free(str);
 }
 
-static int print_pci_devfn(Object *obj, Property *prop, char *dest,
+static int print_pci_devfn(Object *obj, const Property *prop, char *dest,
                            size_t len)
 {
     int32_t *ptr = object_field_prop_ptr(obj, prop);
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index b5a0ab34f3..39959c3432 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -34,7 +34,7 @@  struct PropertyInfo {
     const char *description;
     const QEnumLookup *enum_table;
     bool realized_set_allowed; /* allow setting property on realized device */
-    int (*print)(Object *obj, Property *prop, char *dest, size_t len);
+    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);