netvsc: use hv_get_bytes_to_read
authorstephen hemminger <stephen@networkplumber.org>
Thu, 8 Jun 2017 23:21:19 +0000 (16:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Jun 2017 16:15:02 +0000 (12:15 -0400)
Don't need need to look at write space in netvsc_close.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/netvsc_drv.c

index df6d8e28949e2c20b0a6292eba511c3dd0875084..436a3ad55cfd04e6b245135d4c01ce543dd2e133 100644 (file)
@@ -120,7 +120,7 @@ static int netvsc_close(struct net_device *net)
        struct net_device_context *net_device_ctx = netdev_priv(net);
        struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev);
        int ret;
-       u32 aread, awrite, i, msec = 10, retry = 0, retry_max = 20;
+       u32 aread, i, msec = 10, retry = 0, retry_max = 20;
        struct vmbus_channel *chn;
 
        netif_tx_disable(net);
@@ -141,15 +141,11 @@ static int netvsc_close(struct net_device *net)
                        if (!chn)
                                continue;
 
-                       hv_get_ringbuffer_availbytes(&chn->inbound, &aread,
-                                                    &awrite);
-
+                       aread = hv_get_bytes_to_read(&chn->inbound);
                        if (aread)
                                break;
 
-                       hv_get_ringbuffer_availbytes(&chn->outbound, &aread,
-                                                    &awrite);
-
+                       aread = hv_get_bytes_to_read(&chn->outbound);
                        if (aread)
                                break;
                }