From 6bb55e796740a0b685831faa784efb0c38dd151c Mon Sep 17 00:00:00 2001 From: Cédric Le Goater Date: Tue, 12 Oct 2021 08:20:08 +0200 Subject: aspeed/smc: Remove the 'size' attribute from AspeedSMCFlash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AspeedSMCFlash::size is only used to compute the initial size of the boot_rom region. Not very useful, so directly call memory_region_size() instead. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater --- hw/ssi/aspeed_smc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'hw/ssi/aspeed_smc.c') diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c index 5466be6317..3e4221311a 100644 --- a/hw/ssi/aspeed_smc.c +++ b/hw/ssi/aspeed_smc.c @@ -1186,11 +1186,10 @@ static void aspeed_smc_realize(DeviceState *dev, Error **errp) fl->id = i; fl->controller = s; - fl->size = asc->segments[i].size; memory_region_init_io(&fl->mmio, OBJECT(s), &aspeed_smc_flash_ops, - fl, name, fl->size); + fl, name, asc->segments[i].size); memory_region_add_subregion(&s->mmio_flash, offset, &fl->mmio); - offset += fl->size; + offset += asc->segments[i].size; } /* DMA support */ -- cgit 1.4.1