On 29/10/25 09:28, David Hildenbrand wrote:

@@ -510,11 +514,12 @@ static MemTxResult zpci_write_bar(S390PCIBusDevice *pbdev, uint8_t pcias,                                     uint64_t offset, uint64_t data, uint8_t len)
  {
      MemoryRegion *mr;
+    hwaddr subregion_base_addr;
      mr = pbdev->pdev->io_regions[pcias].memory;
      mr = s390_get_subregion(mr, offset, len);
-    offset -= mr->addr;
-    return memory_region_dispatch_write(mr, offset, data,
+    subregion_base_addr = memory_region_get_address(mr);

Any partixular reason for the temp variable?

To fit the 72-80 chars per line limit. Since various people
asked the same, I'll just replace in place, ignoring the
checkpatch.pl warnings.


+    return memory_region_dispatch_write(mr, offset - subregion_base_addr, data,
                                          size_memop(len) | MO_BE,
                                          MEMTXATTRS_UNSPECIFIED);
  }
@@ -832,6 +837,7 @@ int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8_t r3, uint64_t gaddr,
      S390PCIBusDevice *pbdev;
      MemoryRegion *mr;
      MemTxResult result;
+    hwaddr subregion_base_addr;
      uint64_t offset;
      int i;
      uint32_t fh;
@@ -900,7 +906,8 @@ int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8_t r3, uint64_t gaddr,
      mr = pbdev->pdev->io_regions[pcias].memory;
      mr = s390_get_subregion(mr, offset, len);
-    offset -= mr->addr;
+    subregion_base_addr = memory_region_get_address(mr);

Dito




Reply via email to