mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 18:44:58 -06:00
hw/mem/memory-device: Remove legacy_align from memory_device_pre_plug()
'legacy_align' is always NULL, remove it, simplifying memory_device_pre_plug(). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20240617071118.60464-16-philmd@linaro.org>
This commit is contained in:
parent
d4fdb05b0e
commit
0e0bf77d28
5 changed files with 8 additions and 13 deletions
|
@ -345,7 +345,7 @@ uint64_t get_plugged_memory_size(void)
|
|||
}
|
||||
|
||||
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);
|
||||
|
|
|
@ -69,7 +69,7 @@ void pc_dimm_pre_plug(PCDIMMDevice *dimm, MachineState *machine, Error **errp)
|
|||
&error_abort);
|
||||
trace_mhp_pc_dimm_assigned_slot(slot);
|
||||
|
||||
memory_device_pre_plug(MEMORY_DEVICE(dimm), machine, NULL, errp);
|
||||
memory_device_pre_plug(MEMORY_DEVICE(dimm), machine, errp);
|
||||
}
|
||||
|
||||
void pc_dimm_plug(PCDIMMDevice *dimm, MachineState *machine)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue