diff mbox

[04/29] scsi-disk: use QEMU_IS_ALIGNED macro

Message ID 20170718061005.29518-5-f4bug@amsat.org
State New
Headers show

Commit Message

Philippe Mathieu-Daudé July 18, 2017, 6:09 a.m. UTC
Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/scsi/scsi-disk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index a53f058621..660d068390 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2620,8 +2620,8 @@  static BlockAIOCB *scsi_block_do_sgio(SCSIBlockReq *req,
      * reads and writes that are not aligned to one logical sectors
      * _and_ cover multiple MemoryRegions.
      */
-    assert(offset % s->qdev.blocksize == 0);
-    assert(iov->size % s->qdev.blocksize == 0);
+    assert(QEMU_IS_ALIGNED(offset, s->qdev.blocksize));
+    assert(QEMU_IS_ALIGNED(iov->size, s->qdev.blocksize));
 
     io_header->interface_id = 'S';