aboutsummaryrefslogtreecommitdiff
path: root/hw/i386/pc_sysfw.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2020-05-11 22:52:46 +0200
committerKevin Wolf <kwolf@redhat.com>2020-05-18 19:05:25 +0200
commit4cdd0a774dc35b2ffe6ddb634e0c431f17dfe07e (patch)
treeade222c138a076e433561cef248de17bbf700363 /hw/i386/pc_sysfw.c
parentb1b30ff4df942ef75abb3799889ab2f4c52155e9 (diff)
hw: Use QEMU_IS_ALIGNED() on parallel flash block size
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é <philmd@redhat.com> Message-Id: <20200511205246.24621-1-philmd@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/i386/pc_sysfw.c')
-rw-r--r--hw/i386/pc_sysfw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c
index 2abab3a27c..b8d8ef59eb 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);