[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 1/9] hw/qdev: Constify DeviceState* argument of qdev_get_paren
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 1/9] hw/qdev: Constify DeviceState* argument of qdev_get_parent_bus() |
Date: |
Mon, 13 Feb 2023 08:04:15 +0100 |
The structure is accessed read-only by qdev_get_parent_bus().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/core/qdev.c | 2 +-
include/hw/qdev-core.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index d759c4602c..43d863b0c5 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -330,7 +330,7 @@ bool qdev_machine_modified(void)
return qdev_hot_added || qdev_hot_removed;
}
-BusState *qdev_get_parent_bus(DeviceState *dev)
+BusState *qdev_get_parent_bus(const DeviceState *dev)
{
return dev->parent_bus;
}
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 35fddb19a6..f5b3b2f89a 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -715,7 +715,7 @@ static inline void qdev_init_gpio_in_named(DeviceState *dev,
void qdev_pass_gpios(DeviceState *dev, DeviceState *container,
const char *name);
-BusState *qdev_get_parent_bus(DeviceState *dev);
+BusState *qdev_get_parent_bus(const DeviceState *dev);
/*** BUS API. ***/
--
2.38.1
- [PATCH v2 0/9] hw/qdev: Housekeeping around qdev_get_parent_bus(), Philippe Mathieu-Daudé, 2023/02/13
- [PATCH v2 1/9] hw/qdev: Constify DeviceState* argument of qdev_get_parent_bus(),
Philippe Mathieu-Daudé <=
- [PATCH v2 2/9] hw/audio: Replace dev->parent_bus by qdev_get_parent_bus(dev), Philippe Mathieu-Daudé, 2023/02/13
- [PATCH v2 3/9] hw/block: Replace dev->parent_bus by qdev_get_parent_bus(dev), Philippe Mathieu-Daudé, 2023/02/13
- [PATCH v2 4/9] hw/net: Replace dev->parent_bus by qdev_get_parent_bus(dev), Philippe Mathieu-Daudé, 2023/02/13
- [PATCH v2 5/9] hw/pci: Replace dev->parent_bus by qdev_get_parent_bus(dev), Philippe Mathieu-Daudé, 2023/02/13
- [PATCH v2 6/9] hw/ppc: Replace dev->parent_bus by qdev_get_parent_bus(dev), Philippe Mathieu-Daudé, 2023/02/13
- [PATCH v2 7/9] hw/usb: Replace dev->parent_bus by qdev_get_parent_bus(dev), Philippe Mathieu-Daudé, 2023/02/13
- [PATCH v2 8/9] hw: Use qdev_get_parent_bus() in qdev_get_own_fw_dev_path_from_handler(), Philippe Mathieu-Daudé, 2023/02/13