mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -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
|
@ -997,7 +997,7 @@ PFlashCFI02 *pflash_cfi02_register(hwaddr base,
|
|||
if (blk) {
|
||||
qdev_prop_set_drive(dev, "drive", blk, &error_abort);
|
||||
}
|
||||
assert(size % sector_len == 0);
|
||||
assert(QEMU_IS_ALIGNED(size, sector_len));
|
||||
qdev_prop_set_uint32(dev, "num-blocks", size / sector_len);
|
||||
qdev_prop_set_uint32(dev, "sector-length", sector_len);
|
||||
qdev_prop_set_uint8(dev, "width", width);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue