aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv
diff options
context:
space:
mode:
authorHaiyang Zhang <haiyangz@microsoft.com>2014-04-21 17:54:44 -0400
committerDavid S. Miller <davem@davemloft.net>2014-04-23 14:48:39 -0400
commit893f66277799cd46bdf97429cc5d16a815a51273 (patch)
tree55a10758faa4065052145662badf39d3a67947b6 /drivers/net/hyperv
parent4baab26129e0540746744232022110dbe9e011e7 (diff)
hyperv: Simplify the send_completion variables
The union contains only one member now, so we use the variables in it directly. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv')
-rw-r--r--drivers/net/hyperv/hyperv_net.h10
-rw-r--r--drivers/net/hyperv/netvsc.c7
-rw-r--r--drivers/net/hyperv/netvsc_drv.c8
-rw-r--r--drivers/net/hyperv/rndis_filter.c2
4 files changed, 11 insertions, 16 deletions
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index a1af0f7711e2..d1f7826aa75f 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -136,13 +136,9 @@ struct hv_netvsc_packet {
136 u16 q_idx; 136 u16 q_idx;
137 struct vmbus_channel *channel; 137 struct vmbus_channel *channel;
138 138
139 union { 139 u64 send_completion_tid;
140 struct { 140 void *send_completion_ctx;
141 u64 send_completion_tid; 141 void (*send_completion)(void *context);
142 void *send_completion_ctx;
143 void (*send_completion)(void *context);
144 } send;
145 } completion;
146 142
147 /* This points to the memory after page_buf */ 143 /* This points to the memory after page_buf */
148 struct rndis_message *rndis_msg; 144 struct rndis_message *rndis_msg;
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index b10334773b32..bbee44635035 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -479,9 +479,8 @@ static void netvsc_send_completion(struct netvsc_device *net_device,
479 if (nvsc_packet) { 479 if (nvsc_packet) {
480 q_idx = nvsc_packet->q_idx; 480 q_idx = nvsc_packet->q_idx;
481 channel = nvsc_packet->channel; 481 channel = nvsc_packet->channel;
482 nvsc_packet->completion.send.send_completion( 482 nvsc_packet->send_completion(nvsc_packet->
483 nvsc_packet->completion.send. 483 send_completion_ctx);
484 send_completion_ctx);
485 } 484 }
486 485
487 num_outstanding_sends = 486 num_outstanding_sends =
@@ -534,7 +533,7 @@ int netvsc_send(struct hv_device *device,
534 0xFFFFFFFF; 533 0xFFFFFFFF;
535 sendMessage.msg.v1_msg.send_rndis_pkt.send_buf_section_size = 0; 534 sendMessage.msg.v1_msg.send_rndis_pkt.send_buf_section_size = 0;
536 535
537 if (packet->completion.send.send_completion) 536 if (packet->send_completion)
538 req_id = (ulong)packet; 537 req_id = (ulong)packet;
539 else 538 else
540 req_id = 0; 539 req_id = 0;
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 8f6d53a2ed95..c76b66515e92 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -235,7 +235,7 @@ static void netvsc_xmit_completion(void *context)
235{ 235{
236 struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context; 236 struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context;
237 struct sk_buff *skb = (struct sk_buff *) 237 struct sk_buff *skb = (struct sk_buff *)
238 (unsigned long)packet->completion.send.send_completion_tid; 238 (unsigned long)packet->send_completion_tid;
239 239
240 kfree(packet); 240 kfree(packet);
241 241
@@ -425,9 +425,9 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
425 (num_data_pgs * sizeof(struct hv_page_buffer))); 425 (num_data_pgs * sizeof(struct hv_page_buffer)));
426 426
427 /* Set the completion routine */ 427 /* Set the completion routine */
428 packet->completion.send.send_completion = netvsc_xmit_completion; 428 packet->send_completion = netvsc_xmit_completion;
429 packet->completion.send.send_completion_ctx = packet; 429 packet->send_completion_ctx = packet;
430 packet->completion.send.send_completion_tid = (unsigned long)skb; 430 packet->send_completion_tid = (unsigned long)skb;
431 431
432 isvlan = packet->vlan_tci & VLAN_TAG_PRESENT; 432 isvlan = packet->vlan_tci & VLAN_TAG_PRESENT;
433 433
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index 48f5a0fbd674..99c527adae5b 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -236,7 +236,7 @@ static int rndis_filter_send_request(struct rndis_device *dev,
236 packet->page_buf[0].len; 236 packet->page_buf[0].len;
237 } 237 }
238 238
239 packet->completion.send.send_completion = NULL; 239 packet->send_completion = NULL;
240 240
241 ret = netvsc_send(dev->net_dev->dev, packet); 241 ret = netvsc_send(dev->net_dev->dev, packet);
242 return ret; 242 return ret;