libvduse: Fix compiler warning with -Wshadow=local
PATCH 1/1 libvduse: Fix compiler warning with -Wshadow=local
No need to declare a new variable with the same name here, we can simple re-use the one from the top of the function. With this change, the file now compiles fine with -Wshadow=local.
Signed-off-by Thomas Huth <[email protected]>
--- subprojects/libvduse/libvduse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
subprojects/libvduse/libvduse.c +1 -1
@@ -1031,7 +1031,7 @@ int vduse_dev_handler(VduseDev *dev)/* The iova will be updated by iova_to_va() later, so just remove it */ vduse_iova_remove_region (dev, req.iova.start, req.iova.last);for (i =0 ; i < dev->num_queues; i++) { -VduseVirtq *vq = &dev->vqs[i]; + vq = &dev->vqs[i];if (vq->ready) { if (vduse_queue_update_vring(vq, vq->vring.desc_addr, vq->vring.avail_addr,
Signature · 1 line
2.41.0
Quoted 7 lines · Thomas Huth
No need to declare a new variable with the same name here, we can simple re-use the one from the top of the function. With this change, the file now compiles fine with -Wshadow=local.
Signed-off-by Thomas Huth <[email protected]>---
Reviewed-by Xie Yongji <[email protected]>
Thanks,
Yongji
Markus Armbruster
AppliedQuoted 5 lines · Thomas Huth
No need to declare a new variable with the same name here, we can simple re-use the one from the top of the function. With this change, the file now compiles fine with -Wshadow=local.
Signed-off-by Thomas Huth <[email protected]>
Queued. Thanks!