* [PATCH] libvduse: Fix compiler warning with -Wshadow=local
@ 2023-10-06 12:08 Thomas Huth
2023-10-07 8:03 ` Yongji Xie
2023-10-12 6:07 ` Markus Armbruster
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Huth @ 2023-10-06 12:08 UTC (permalink / raw)
To: qemu-devel, Xie Yongji; +Cc: qemu-trivial, Markus Armbruster
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 <thuth@redhat.com>
---
subprojects/libvduse/libvduse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse/libvduse.c
index 377959a0b4..21ffbb5b8d 100644
--- a/subprojects/libvduse/libvduse.c
+++ b/subprojects/libvduse/libvduse.c
@@ -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,
--
2.41.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] libvduse: Fix compiler warning with -Wshadow=local
2023-10-06 12:08 [PATCH] libvduse: Fix compiler warning with -Wshadow=local Thomas Huth
@ 2023-10-07 8:03 ` Yongji Xie
2023-10-12 6:07 ` Markus Armbruster
1 sibling, 0 replies; 3+ messages in thread
From: Yongji Xie @ 2023-10-07 8:03 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu devel list, qemu-trivial, Markus Armbruster
On Fri, Oct 6, 2023 at 8:08 PM Thomas Huth <thuth@redhat.com> wrote:
>
> 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 <thuth@redhat.com>
> ---
Reviewed-by: Xie Yongji <xieyongji@bytedance.com>
Thanks,
Yongji
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] libvduse: Fix compiler warning with -Wshadow=local
2023-10-06 12:08 [PATCH] libvduse: Fix compiler warning with -Wshadow=local Thomas Huth
2023-10-07 8:03 ` Yongji Xie
@ 2023-10-12 6:07 ` Markus Armbruster
1 sibling, 0 replies; 3+ messages in thread
From: Markus Armbruster @ 2023-10-12 6:07 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel, Xie Yongji, qemu-trivial
Thomas Huth <thuth@redhat.com> writes:
> 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 <thuth@redhat.com>
Queued. Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-12 6:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-06 12:08 [PATCH] libvduse: Fix compiler warning with -Wshadow=local Thomas Huth
2023-10-07 8:03 ` Yongji Xie
2023-10-12 6:07 ` Markus Armbruster
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).