]> Git Repo - qemu.git/commitdiff
hw/nvram/fw_cfg: Use memberwise copy of MemoryRegionOps struct
authorPeter Maydell <[email protected]>
Fri, 24 Aug 2018 17:04:21 +0000 (18:04 +0100)
committerPaolo Bonzini <[email protected]>
Tue, 2 Oct 2018 17:09:14 +0000 (19:09 +0200)
We've now removed the 'old_mmio' member from MemoryRegionOps,
so we can perform the copy as a simple struct copy rather
than having to do it via a memberwise copy.

Signed-off-by: Peter Maydell <[email protected]>
Message-Id: <20180824170422[email protected]>
Based-on: <20180802174042[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
hw/nvram/fw_cfg.c

index 6de7809f1a2f9aa3535432fcd0e4565bba399367..946f765f7f791d126a83968f142adf3516bd3836 100644 (file)
@@ -1115,12 +1115,7 @@ static void fw_cfg_mem_realize(DeviceState *dev, Error **errp)
     sysbus_init_mmio(sbd, &s->ctl_iomem);
 
     if (s->data_width > data_ops->valid.max_access_size) {
-        /* memberwise copy because the "old_mmio" member is const */
-        s->wide_data_ops.read       = data_ops->read;
-        s->wide_data_ops.write      = data_ops->write;
-        s->wide_data_ops.endianness = data_ops->endianness;
-        s->wide_data_ops.valid      = data_ops->valid;
-        s->wide_data_ops.impl       = data_ops->impl;
+        s->wide_data_ops = *data_ops;
 
         s->wide_data_ops.valid.max_access_size = s->data_width;
         s->wide_data_ops.impl.max_access_size  = s->data_width;
This page took 0.029404 seconds and 4 git commands to generate.