On 28/10/2025 19.12, Philippe Mathieu-Daudé wrote:
MemoryRegion::addr is private data of MemoryRegion, use
memory_region_get_address() to access it.
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
hw/s390x/s390-pci-inst.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c
index 5841dfc4fec..d4adf782ca1 100644
--- a/hw/s390x/s390-pci-inst.c
+++ b/hw/s390x/s390-pci-inst.c
@@ -394,11 +394,14 @@ static MemoryRegion *s390_get_subregion(MemoryRegion *mr,
uint64_t offset,
{
MemoryRegion *subregion;
uint64_t subregion_size;
+ hwaddr subregion_addr;
QTAILQ_FOREACH(subregion, &mr->subregions, subregions_link) {
subregion_size = memory_region_size(subregion);
- if ((offset >= subregion->addr) &&
- (offset + len) <= (subregion->addr + subregion_size)) {
+ subregion_addr = memory_region_get_address(subregion);
+
+ if ((offset >= subregion_addr) &&
+ (offset + len) <= (subregion_addr + subregion_size)) {
While you're at it, you could also drop the superfluous parentheses here.
Anyway:
Reviewed-by: Thomas Huth <[email protected]>