mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 02:54:58 -06:00
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>
This commit is contained in:
parent
b1b30ff4df
commit
4cdd0a774d
6 changed files with 6 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue