* [PATCH] hw/net/vhost_net: Silence compiler warning when compiling with -Wshadow
@ 2023-10-04 8:49 Thomas Huth
2023-10-04 8:57 ` Michael S. Tsirkin
2023-10-04 10:44 ` Markus Armbruster
0 siblings, 2 replies; 4+ messages in thread
From: Thomas Huth @ 2023-10-04 8:49 UTC (permalink / raw)
To: qemu-devel, Michael S. Tsirkin, Jason Wang
Cc: Markus Armbruster, qemu-trivial
Rename the innermost local variables to avoid compiler warnings
with "-Wshadow".
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/net/vhost_net.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 57427a3997..e8e1661646 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -313,8 +313,8 @@ fail:
/* Queue might not be ready for start */
continue;
}
- int r = vhost_net_set_backend(&net->dev, &file);
- assert(r >= 0);
+ int ret = vhost_net_set_backend(&net->dev, &file);
+ assert(ret >= 0);
}
}
if (net->nc->info->poll) {
@@ -629,8 +629,8 @@ err_start:
if (net->nc->info->type == NET_CLIENT_DRIVER_TAP) {
file.fd = VHOST_FILE_UNBIND;
file.index = idx;
- int r = vhost_net_set_backend(&net->dev, &file);
- assert(r >= 0);
+ int ret = vhost_net_set_backend(&net->dev, &file);
+ assert(ret >= 0);
}
vhost_dev_stop(&net->dev, vdev, false);
--
2.41.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/net/vhost_net: Silence compiler warning when compiling with -Wshadow
2023-10-04 8:49 [PATCH] hw/net/vhost_net: Silence compiler warning when compiling with -Wshadow Thomas Huth
@ 2023-10-04 8:57 ` Michael S. Tsirkin
2023-10-08 5:27 ` Jason Wang
2023-10-04 10:44 ` Markus Armbruster
1 sibling, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2023-10-04 8:57 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel, Jason Wang, Markus Armbruster, qemu-trivial
On Wed, Oct 04, 2023 at 10:49:39AM +0200, Thomas Huth wrote:
> Rename the innermost local variables to avoid compiler warnings
> with "-Wshadow".
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
feel free to merge
> ---
> hw/net/vhost_net.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
> index 57427a3997..e8e1661646 100644
> --- a/hw/net/vhost_net.c
> +++ b/hw/net/vhost_net.c
> @@ -313,8 +313,8 @@ fail:
> /* Queue might not be ready for start */
> continue;
> }
> - int r = vhost_net_set_backend(&net->dev, &file);
> - assert(r >= 0);
> + int ret = vhost_net_set_backend(&net->dev, &file);
> + assert(ret >= 0);
> }
> }
> if (net->nc->info->poll) {
> @@ -629,8 +629,8 @@ err_start:
> if (net->nc->info->type == NET_CLIENT_DRIVER_TAP) {
> file.fd = VHOST_FILE_UNBIND;
> file.index = idx;
> - int r = vhost_net_set_backend(&net->dev, &file);
> - assert(r >= 0);
> + int ret = vhost_net_set_backend(&net->dev, &file);
> + assert(ret >= 0);
> }
>
> vhost_dev_stop(&net->dev, vdev, false);
> --
> 2.41.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/net/vhost_net: Silence compiler warning when compiling with -Wshadow
2023-10-04 8:57 ` Michael S. Tsirkin
@ 2023-10-08 5:27 ` Jason Wang
0 siblings, 0 replies; 4+ messages in thread
From: Jason Wang @ 2023-10-08 5:27 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Thomas Huth, qemu-devel, Markus Armbruster, qemu-trivial
On Wed, Oct 4, 2023 at 4:57 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Wed, Oct 04, 2023 at 10:49:39AM +0200, Thomas Huth wrote:
> > Rename the innermost local variables to avoid compiler warnings
> > with "-Wshadow".
> >
> > Signed-off-by: Thomas Huth <thuth@redhat.com>
>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Thanks
>
> feel free to merge
>
> > ---
> > hw/net/vhost_net.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
> > index 57427a3997..e8e1661646 100644
> > --- a/hw/net/vhost_net.c
> > +++ b/hw/net/vhost_net.c
> > @@ -313,8 +313,8 @@ fail:
> > /* Queue might not be ready for start */
> > continue;
> > }
> > - int r = vhost_net_set_backend(&net->dev, &file);
> > - assert(r >= 0);
> > + int ret = vhost_net_set_backend(&net->dev, &file);
> > + assert(ret >= 0);
> > }
> > }
> > if (net->nc->info->poll) {
> > @@ -629,8 +629,8 @@ err_start:
> > if (net->nc->info->type == NET_CLIENT_DRIVER_TAP) {
> > file.fd = VHOST_FILE_UNBIND;
> > file.index = idx;
> > - int r = vhost_net_set_backend(&net->dev, &file);
> > - assert(r >= 0);
> > + int ret = vhost_net_set_backend(&net->dev, &file);
> > + assert(ret >= 0);
> > }
> >
> > vhost_dev_stop(&net->dev, vdev, false);
> > --
> > 2.41.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/net/vhost_net: Silence compiler warning when compiling with -Wshadow
2023-10-04 8:49 [PATCH] hw/net/vhost_net: Silence compiler warning when compiling with -Wshadow Thomas Huth
2023-10-04 8:57 ` Michael S. Tsirkin
@ 2023-10-04 10:44 ` Markus Armbruster
1 sibling, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2023-10-04 10:44 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel, Michael S. Tsirkin, Jason Wang, qemu-trivial
Thomas Huth <thuth@redhat.com> writes:
> Rename the innermost local variables to avoid compiler warnings
> with "-Wshadow".
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
Queued. Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-08 5:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-04 8:49 [PATCH] hw/net/vhost_net: Silence compiler warning when compiling with -Wshadow Thomas Huth
2023-10-04 8:57 ` Michael S. Tsirkin
2023-10-08 5:27 ` Jason Wang
2023-10-04 10:44 ` 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).