aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-06-22 13:04:16 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2017-08-31 12:29:07 +0200
commit33c5793bd92b85b0d3666f35e44cef855b48e76a (patch)
tree21f894889d8dda506d022c45f44b1b54bcf88dbf /hw/virtio
parentcf7a09c1e4e4869c1257c1490e770b8801f8ec43 (diff)
downloadqemu-33c5793bd92b85b0d3666f35e44cef855b48e76a.zip
qemu-33c5793bd92b85b0d3666f35e44cef855b48e76a.tar.gz
qemu-33c5793bd92b85b0d3666f35e44cef855b48e76a.tar.bz2
vhost: use QEMU_ALIGN_DOWN
I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'hw/virtio')
-rw-r--r--hw/virtio/vhost.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 6eddb09..0049a2c 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -70,7 +70,7 @@ static void vhost_dev_sync_region(struct vhost_dev *dev,
uint64_t end = MIN(mlast, rlast);
vhost_log_chunk_t *from = log + start / VHOST_LOG_CHUNK;
vhost_log_chunk_t *to = log + end / VHOST_LOG_CHUNK + 1;
- uint64_t addr = (start / VHOST_LOG_CHUNK) * VHOST_LOG_CHUNK;
+ uint64_t addr = QEMU_ALIGN_DOWN(start, VHOST_LOG_CHUNK);
if (end < start) {
return;