summaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv/netvsc_drv.c
diff options
context:
space:
mode:
authorStephen Hemminger2017-12-13 01:48:37 +0100
committerDavid S. Miller2017-12-13 21:57:38 +0100
commit79cf1bae384cfc51b0b0773b3591794302af6ebd (patch)
treedad3ccb989e1a023cdc69aefe6acb366ba13dbaa /drivers/net/hyperv/netvsc_drv.c
parenthv_netvsc: track memory allocation failures in ethtool stats (diff)
downloadkernel-qcow2-linux-79cf1bae384cfc51b0b0773b3591794302af6ebd.tar.gz
kernel-qcow2-linux-79cf1bae384cfc51b0b0773b3591794302af6ebd.tar.xz
kernel-qcow2-linux-79cf1bae384cfc51b0b0773b3591794302af6ebd.zip
hv_netvsc: simplify function args in receive status path
The caller (netvsc_receive) already has the net device pointer, and should just pass that to functions rather than the hyperv device. This eliminates several impossible error paths in the process. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv/netvsc_drv.c')
-rw-r--r--drivers/net/hyperv/netvsc_drv.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 10615510727a..3997c2d64427 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -652,22 +652,14 @@ no_memory:
/*
* netvsc_linkstatus_callback - Link up/down notification
*/
-void netvsc_linkstatus_callback(struct hv_device *device_obj,
+void netvsc_linkstatus_callback(struct net_device *net,
struct rndis_message *resp)
{
struct rndis_indicate_status *indicate = &resp->msg.indicate_status;
- struct net_device *net;
- struct net_device_context *ndev_ctx;
+ struct net_device_context *ndev_ctx = netdev_priv(net);
struct netvsc_reconfig *event;
unsigned long flags;
- net = hv_get_drvdata(device_obj);
-
- if (!net)
- return;
-
- ndev_ctx = netdev_priv(net);
-
/* Update the physical link speed when changing to another vSwitch */
if (indicate->status == RNDIS_STATUS_LINK_SPEED_CHANGE) {
u32 speed;