hw/net/vhost_net: Silence compiler warning when compiling with -Wshadow
PATCH 1/1 hw/net/vhost_net: Silence compiler warning when compiling with -Wshadow
Rename the innermost local variables to avoid compiler warnings with "-Wshadow".
Signed-off-by Thomas Huth <[email protected]>
--- hw/net/vhost_net.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
hw/net/vhost_net.c +4 -4
@@ -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);
Signature · 1 line
2.41.0
Quoted 4 lines · Thomas Huth
Rename the innermost local variables to avoid compiler warnings with "-Wshadow".
Signed-off-by Thomas Huth <[email protected]>
Reviewed-by Michael S. Tsirkin <[email protected]>
feel free to merge
Quoted 32 lines
--- hw/net/vhost_net.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)hw/net/vhost_net.c +4
-4@@ -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);Signature · 1 line
2.41.0
Jason Wang
Acked-byQuoted 8 lines · Michael S. Tsirkin
Quoted 4 lines · Thomas Huth
Rename the innermost local variables to avoid compiler warnings with "-Wshadow".
Signed-off-by Thomas Huth <[email protected]>Reviewed-by Michael S. Tsirkin <[email protected]>
Acked-by Jason Wang <[email protected]>
Thanks
Quoted 36 lines
feel free to merge
Quoted 32 lines
--- hw/net/vhost_net.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)hw/net/vhost_net.c +4
-5@@ -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
Markus Armbruster
AppliedQuoted 4 lines · Thomas Huth
Rename the innermost local variables to avoid compiler warnings with "-Wshadow".
Signed-off-by Thomas Huth <[email protected]>
Queued. Thanks!