On 24/10/2025 20:03, Philippe Mathieu-Daudé wrote:

MemoryRegion::name is kind of internal. Use the proper
memory_region_name() accessor, which might return a different
name.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
  hw/core/sysbus.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index ae447c1196a..d33be6b2b52 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -154,7 +154,7 @@ void sysbus_mmio_map(SysBusDevice *dev, int n, hwaddr addr)
  int sysbus_mmio_map_name(SysBusDevice *dev, const char *name, hwaddr addr)
  {
      for (int i = 0; i < dev->num_mmio; i++) {
-        if (!strcmp(dev->mmio[i].memory->name, name)) {
+        if (!strcmp(memory_region_name(dev->mmio[i].memory), name)) {
              sysbus_mmio_map(dev, i, addr);
              return i;
          }

Interesting. I'm mildly curious as to if you discovered anything that broke with this change (even though I agree it is correct)?


ATB,

Mark.


Reply via email to