qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH-for-9.1 v2 14/21] hw/mem/memory-device: Remove legacy_align f


From: David Hildenbrand
Subject: Re: [PATCH-for-9.1 v2 14/21] hw/mem/memory-device: Remove legacy_align from memory_device_pre_plug()
Date: Wed, 27 Mar 2024 12:19:13 +0100
User-agent: Mozilla Thunderbird

  void memory_device_pre_plug(MemoryDeviceState *md, MachineState *ms,
-                            const uint64_t *legacy_align, Error **errp)
+                            Error **errp)
  {
      const MemoryDeviceClass *mdc = MEMORY_DEVICE_GET_CLASS(md);
      Error *local_err = NULL;
@@ -388,14 +388,10 @@ void memory_device_pre_plug(MemoryDeviceState *md, 
MachineState *ms,
          return;
      }
- if (legacy_align) {
-        align = *legacy_align;
-    } else {
-        if (mdc->get_min_alignment) {
-            align = mdc->get_min_alignment(md);
-        }
-        align = MAX(align, memory_region_get_alignment(mr));
+    if (mdc->get_min_alignment) {
+        align = mdc->get_min_alignment(md);
      }
+    align = MAX(align, memory_region_get_alignment(mr));
      addr = mdc->get_addr(md);
      addr = memory_device_get_free_addr(ms, !addr ? NULL : &addr, align,
                                         memory_region_size(mr), &local_err);

Very nice!

Reviewed-by: David Hildenbrand <david@redhat.com>

--
Cheers,

David / dhildenb




reply via email to

[Prev in Thread] Current Thread [Next in Thread]