[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v2 12/30] trace: Fix parameter types in hw/block
From: |
Eric Blake |
Subject: |
[Qemu-block] [PATCH v2 12/30] trace: Fix parameter types in hw/block |
Date: |
Mon, 13 Mar 2017 14:55:29 -0500 |
An upcoming patch will let the compiler warn us when we are silently
losing precision in traces; in this patch, switching from
'/ BDRV_SECTOR_SIZE' (which changes types to unsigned long long) to
'>> BDRV_SECTOR_BITS' (which preserves the type at size_t) is sufficient
to match the existing trace definition.
Signed-off-by: Eric Blake <address@hidden>
---
hw/block/virtio-blk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 98c16a7..b609202 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -529,11 +529,11 @@ static int virtio_blk_handle_request(VirtIOBlockReq *req,
MultiReqBuffer *mrb)
if (is_write) {
qemu_iovec_init_external(&req->qiov, iov, out_num);
trace_virtio_blk_handle_write(req, req->sector_num,
- req->qiov.size / BDRV_SECTOR_SIZE);
+ req->qiov.size >> BDRV_SECTOR_BITS);
} else {
qemu_iovec_init_external(&req->qiov, in_iov, in_num);
trace_virtio_blk_handle_read(req, req->sector_num,
- req->qiov.size / BDRV_SECTOR_SIZE);
+ req->qiov.size >> BDRV_SECTOR_BITS);
}
if (!virtio_blk_sect_range_ok(req->dev, req->sector_num,
--
2.9.3
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-block] [PATCH v2 12/30] trace: Fix parameter types in hw/block,
Eric Blake <=