block: Use QEMU_IS_ALIGNED
authorNir Soffer <nirsof@gmail.com>
Tue, 27 Aug 2019 18:59:12 +0000 (21:59 +0300)
committerMax Reitz <mreitz@redhat.com>
Mon, 16 Sep 2019 12:48:30 +0000 (14:48 +0200)
commit1bbbf32d5fffe334531c315d7bd865fdfb67b6c5
treee8f70cc6cd882948f07a8dd568b625ab7bac2e3e
parentdd25f97c66a75d1508f1d4c6478ed2c95bec428f
block: Use QEMU_IS_ALIGNED

Replace instances of:

    (n & (BDRV_SECTOR_SIZE - 1)) == 0

And:

   (n & ~BDRV_SECTOR_MASK) == 0

With:

    QEMU_IS_ALIGNED(n, BDRV_SECTOR_SIZE)

Which reveals the intent of the code better, and makes it easier to
locate the code checking alignment.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Message-id: 20190827185913.27427-2-nsoffer@redhat.com
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/bochs.c
block/cloop.c
block/dmg.c
block/io.c
block/qcow2-cluster.c
block/qcow2.c
block/vvfat.c
qemu-img.c