diff mbox series

[5/9] vhost-vdpa: remove the unnecessary initialization

Message ID 20200831082737.10983-6-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
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 net/vhost-vdpa.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Laurent Vivier Sept. 16, 2020, 3:53 p.m. UTC | #1
On 31/08/2020 10:27, Jason Wang wrote:
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>  net/vhost-vdpa.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
> index 397d4d3082..bcbf49d55b 100644
> --- a/net/vhost-vdpa.c
> +++ b/net/vhost-vdpa.c
> @@ -175,10 +175,10 @@ static NetClientInfo net_vhost_vdpa_info = {
>  static int net_vhost_vdpa_init(NetClientState *peer, const char *device,
>                                 const char *name, const char *vhostdev)
>  {
> -    NetClientState *nc = NULL;
> +    NetClientState *nc;
>      VhostVDPAState *s;
> -    int vdpa_device_fd = -1;
> -    int ret = 0;
> +    int vdpa_device_fd;
> +    int ret;
>      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);
> 

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

Patch

diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 397d4d3082..bcbf49d55b 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -175,10 +175,10 @@  static NetClientInfo net_vhost_vdpa_info = {
 static int net_vhost_vdpa_init(NetClientState *peer, const char *device,
                                const char *name, const char *vhostdev)
 {
-    NetClientState *nc = NULL;
+    NetClientState *nc;
     VhostVDPAState *s;
-    int vdpa_device_fd = -1;
-    int ret = 0;
+    int vdpa_device_fd;
+    int ret;
     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);