Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 893f6627 authored by Haiyang Zhang's avatar Haiyang Zhang Committed by David S. Miller
Browse files

hyperv: Simplify the send_completion variables



The union contains only one member now, so we use the variables in it directly.

Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4baab261
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -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;

	/* This points to the memory after page_buf */
	struct rndis_message *rndis_msg;
+3 −4
Original line number Diff line number Diff line
@@ -479,8 +479,7 @@ 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.
			nvsc_packet->send_completion(nvsc_packet->
						     send_completion_ctx);
		}

@@ -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;
+4 −4
Original line number Diff line number Diff line
@@ -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;

+1 −1
Original line number Diff line number Diff line
@@ -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;