diff options
author | Philippe Mathieu-Daudé <philmd@redhat.com> | 2020-05-11 22:52:46 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2020-05-18 19:05:25 +0200 |
commit | 4cdd0a774dc35b2ffe6ddb634e0c431f17dfe07e (patch) | |
tree | ade222c138a076e433561cef248de17bbf700363 /hw/block/pflash_cfi02.c | |
parent | b1b30ff4df942ef75abb3799889ab2f4c52155e9 (diff) | |
download | qemu-4cdd0a774dc35b2ffe6ddb634e0c431f17dfe07e.zip qemu-4cdd0a774dc35b2ffe6ddb634e0c431f17dfe07e.tar.gz qemu-4cdd0a774dc35b2ffe6ddb634e0c431f17dfe07e.tar.bz2 |
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/block/pflash_cfi02.c')
-rw-r--r-- | hw/block/pflash_cfi02.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c index f0579ec..c277b03 100644 --- a/hw/block/pflash_cfi02.c +++ b/hw/block/pflash_cfi02.c @@ -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); |