From 4cdd0a774dc35b2ffe6ddb634e0c431f17dfe07e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= 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/i386/pc_sysfw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/i386') diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index 2abab3a..b8d8ef5 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -167,7 +167,7 @@ static void pc_system_flash_map(PCMachineState *pcms, blk_name(blk), strerror(-size)); exit(1); } - if (size == 0 || size % FLASH_SECTOR_SIZE != 0) { + if (size == 0 || !QEMU_IS_ALIGNED(size, FLASH_SECTOR_SIZE)) { error_report("system firmware block device %s has invalid size " "%" PRId64, blk_name(blk), size); -- cgit v1.1