Skip to content

Commit

Permalink
hw/net/vhost_net: Silence compiler warning when compiling with -Wshadow
Browse files Browse the repository at this point in the history
Rename the innermost local variables to avoid compiler warnings
with "-Wshadow".

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20231004084939.96349-1-thuth@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
  • Loading branch information
huth authored and Markus Armbruster committed Oct 6, 2023
1 parent 071add9 commit 5d63cb1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hw/net/vhost_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ static int vhost_net_start_one(struct vhost_net *net,
/* 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) {
Expand Down Expand Up @@ -629,8 +629,8 @@ int vhost_net_virtqueue_restart(VirtIODevice *vdev, NetClientState *nc,
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);
Expand Down

0 comments on commit 5d63cb1

Please sign in to comment.