On 07/18/2017 01:09 AM, Philippe Mathieu-Daudé wrote: > Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci > > Signed-off-by: Philippe Mathieu-Daudé <[email protected]> > --- > block/io.c | 4 ++-- > block/qcow2-cache.c | 2 +- > block/vhdx-log.c | 2 +- > block/vvfat.c | 2 +- > 4 files changed, 5 insertions(+), 5 deletions(-)
The first three look okay,
> --- a/block/vvfat.c
> +++ b/block/vvfat.c
> @@ -454,7 +454,7 @@ static direntry_t *create_long_filename(BDRVVVFATState
> *s, const char *filename)
> entry=array_get(&(s->directory),s->directory.next-1-(i/26));
> if (i >= 2 * length + 2) {
> entry->name[offset] = 0xff;
> - } else if (i % 2 == 0) {
> + } else if (QEMU_IS_ALIGNED(i, 2)) {
> entry->name[offset] = longname[i / 2] & 0xff;
> } else {
> entry->name[offset] = longname[i / 2] >> 8;
but this one looks a bit odd. Code-wise, it's identical, but
semantically, this doesn't feel like an alignment check, so much as an
even-or-odd check.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
