From 4cdd0a774dc35b2ffe6ddb634e0c431f17dfe07e Mon Sep 17 00:00:00 2001 From: Philippe Mathieu-Daudé Date: Mon, 11 May 2020 22:52:46 +0200 Subject: hw: Use QEMU_IS_ALIGNED() on parallel flash block size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the QEMU_IS_ALIGNED() macro to verify the flash block size is properly aligned. It is quicker to process when reviewing. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200511205246.24621-1-philmd@redhat.com> Reviewed-by: Alistair Francis Reviewed-by: Peter Maydell Acked-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- hw/arm/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/arm/virt.c') diff --git a/hw/arm/virt.c b/hw/arm/virt.c index c41d5f9778..37462a6f78 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -977,7 +977,7 @@ static void virt_flash_map1(PFlashCFI01 *flash, { DeviceState *dev = DEVICE(flash); - assert(size % VIRT_FLASH_SECTOR_SIZE == 0); + assert(QEMU_IS_ALIGNED(size, VIRT_FLASH_SECTOR_SIZE)); assert(size / VIRT_FLASH_SECTOR_SIZE <= UINT32_MAX); qdev_prop_set_uint32(dev, "num-blocks", size / VIRT_FLASH_SECTOR_SIZE); qdev_init_nofail(dev); -- cgit 1.4.1