On Tue, Aug 20, 2019 at 10:51 PM Max Reitz wrote:
> On 17.08.19 19:53, Nir Soffer wrote:
> > Replace instances of:
> >
> > (n & (BDRV_SECTOR_SIZE - 1)) == 0)
> >
> > With:
> >
> > QEMU_IS_ALIGNED(n, BDRV_SECTOR_SIZE)
> >
> > Which reveals the intent of the code better, and makes it easier
On 17.08.19 19:53, Nir Soffer wrote:
> Replace instances of:
>
> (n & (BDRV_SECTOR_SIZE - 1)) == 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.
>
> QEMU_IS_ALIGNED is im
Replace instances of:
(n & (BDRV_SECTOR_SIZE - 1)) == 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.
QEMU_IS_ALIGNED is implemented using %, which may be less efficient but
it is used