diff mbox series

[6/9] vhost-vdpa: remove the unnecessary queue index assignment

Message ID 20200831082737.10983-7-jasowang@redhat.com
State New
Headers show
Series refine vhost-vdpa initialization | expand

Commit Message

Jason Wang Aug. 31, 2020, 8:27 a.m. UTC
The nc is allocated through g_malloc0(), so no need to assign its
queue_index to zero.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 net/vhost-vdpa.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Laurent Vivier Sept. 16, 2020, 3:54 p.m. UTC | #1
On 31/08/2020 10:27, Jason Wang wrote:
> The nc is allocated through g_malloc0(), so no need to assign its
> queue_index to zero.
> 
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>  net/vhost-vdpa.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
> index bcbf49d55b..1d3ac89135 100644
> --- a/net/vhost-vdpa.c
> +++ b/net/vhost-vdpa.c
> @@ -182,7 +182,6 @@ static int net_vhost_vdpa_init(NetClientState *peer, const char *device,
>      assert(name);
>      nc = qemu_new_net_client(&net_vhost_vdpa_info, peer, device, name);
>      snprintf(nc->info_str, sizeof(nc->info_str), "vhostdev=%s", vhostdev);
> -    nc->queue_index = 0;
>      s = DO_UPCAST(VhostVDPAState, nc, nc);
>      vdpa_device_fd = qemu_open(vhostdev, O_RDWR);
>      if (vdpa_device_fd == -1) {
> 

Reviewed-by: Laurent Vivier <lvivier@redhat.com>
diff mbox series

Patch

diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index bcbf49d55b..1d3ac89135 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -182,7 +182,6 @@  static int net_vhost_vdpa_init(NetClientState *peer, const char *device,
     assert(name);
     nc = qemu_new_net_client(&net_vhost_vdpa_info, peer, device, name);
     snprintf(nc->info_str, sizeof(nc->info_str), "vhostdev=%s", vhostdev);
-    nc->queue_index = 0;
     s = DO_UPCAST(VhostVDPAState, nc, nc);
     vdpa_device_fd = qemu_open(vhostdev, O_RDWR);
     if (vdpa_device_fd == -1) {