]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
hyperv: Simplify the send_completion variables
authorHaiyang Zhang <haiyangz@microsoft.com>
Mon, 21 Apr 2014 21:54:44 +0000 (14:54 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Apr 2014 18:48:39 +0000 (14:48 -0400)
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>
drivers/net/hyperv/hyperv_net.h
drivers/net/hyperv/netvsc.c
drivers/net/hyperv/netvsc_drv.c
drivers/net/hyperv/rndis_filter.c

index a1af0f7711e28a76c74e7f3b59637725770c59a9..d1f7826aa75f2032a7bb136a22a55a6c7af2a29f 100644 (file)
@@ -136,13 +136,9 @@ struct hv_netvsc_packet {
        u16 q_idx;
        struct vmbus_channel *channel;
 
-       union {
-               struct {
-                       u64 send_completion_tid;
-                       void *send_completion_ctx;
-                       void (*send_completion)(void *context);
-               } send;
-       } completion;
+       u64 send_completion_tid;
+       void *send_completion_ctx;
+       void (*send_completion)(void *context);
 
        /* This points to the memory after page_buf */
        struct rndis_message *rndis_msg;
index b10334773b328a07121fa4f32bbaa14f2590b40a..bbee446350350e7138442c7e35fc79e91b7cde0d 100644 (file)
@@ -479,9 +479,8 @@ static void netvsc_send_completion(struct netvsc_device *net_device,
                if (nvsc_packet) {
                        q_idx = nvsc_packet->q_idx;
                        channel = nvsc_packet->channel;
-                       nvsc_packet->completion.send.send_completion(
-                               nvsc_packet->completion.send.
-                               send_completion_ctx);
+                       nvsc_packet->send_completion(nvsc_packet->
+                                                    send_completion_ctx);
                }
 
                num_outstanding_sends =
@@ -534,7 +533,7 @@ int netvsc_send(struct hv_device *device,
                0xFFFFFFFF;
        sendMessage.msg.v1_msg.send_rndis_pkt.send_buf_section_size = 0;
 
-       if (packet->completion.send.send_completion)
+       if (packet->send_completion)
                req_id = (ulong)packet;
        else
                req_id = 0;
index 8f6d53a2ed95ee14e1e9e705779b9de3e145f020..c76b66515e920dd32ecb0536c54608c48260109f 100644 (file)
@@ -235,7 +235,7 @@ static void netvsc_xmit_completion(void *context)
 {
        struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context;
        struct sk_buff *skb = (struct sk_buff *)
-               (unsigned long)packet->completion.send.send_completion_tid;
+               (unsigned long)packet->send_completion_tid;
 
        kfree(packet);
 
@@ -425,9 +425,9 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
                                (num_data_pgs * sizeof(struct hv_page_buffer)));
 
        /* Set the completion routine */
-       packet->completion.send.send_completion = netvsc_xmit_completion;
-       packet->completion.send.send_completion_ctx = packet;
-       packet->completion.send.send_completion_tid = (unsigned long)skb;
+       packet->send_completion = netvsc_xmit_completion;
+       packet->send_completion_ctx = packet;
+       packet->send_completion_tid = (unsigned long)skb;
 
        isvlan = packet->vlan_tci & VLAN_TAG_PRESENT;
 
index 48f5a0fbd6748d072f123f068d346aff4e42f06a..99c527adae5bf1ee154b2a02eb0f93a6df32e333 100644 (file)
@@ -236,7 +236,7 @@ static int rndis_filter_send_request(struct rndis_device *dev,
                        packet->page_buf[0].len;
        }
 
-       packet->completion.send.send_completion = NULL;
+       packet->send_completion = NULL;
 
        ret = netvsc_send(dev->net_dev->dev, packet);
        return ret;