Commit 956a25c9 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

hyperv: netvsc: Neaten netvsc_send_pkt by using a temporary

Repeated dereference of nvmsg.msg.v1_msg.send_rndis_pkt can be
shortened by using a temporary.  Do so.

No change in object code.

Miscellanea:

o Use * const for rpkt and nvchan
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cb5b136c
...@@ -747,8 +747,10 @@ static inline int netvsc_send_pkt( ...@@ -747,8 +747,10 @@ static inline int netvsc_send_pkt(
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct nvsp_message nvmsg; struct nvsp_message nvmsg;
struct netvsc_channel *nvchan struct nvsp_1_message_send_rndis_packet * const rpkt =
= &net_device->chan_table[packet->q_idx]; &nvmsg.msg.v1_msg.send_rndis_pkt;
struct netvsc_channel * const nvchan =
&net_device->chan_table[packet->q_idx];
struct vmbus_channel *out_channel = nvchan->channel; struct vmbus_channel *out_channel = nvchan->channel;
struct net_device *ndev = hv_get_drvdata(device); struct net_device *ndev = hv_get_drvdata(device);
struct netdev_queue *txq = netdev_get_tx_queue(ndev, packet->q_idx); struct netdev_queue *txq = netdev_get_tx_queue(ndev, packet->q_idx);
...@@ -757,21 +759,16 @@ static inline int netvsc_send_pkt( ...@@ -757,21 +759,16 @@ static inline int netvsc_send_pkt(
u32 ring_avail = hv_ringbuf_avail_percent(&out_channel->outbound); u32 ring_avail = hv_ringbuf_avail_percent(&out_channel->outbound);
nvmsg.hdr.msg_type = NVSP_MSG1_TYPE_SEND_RNDIS_PKT; nvmsg.hdr.msg_type = NVSP_MSG1_TYPE_SEND_RNDIS_PKT;
if (skb != NULL) { if (skb)
/* 0 is RMC_DATA; */ rpkt->channel_type = 0; /* 0 is RMC_DATA */
nvmsg.msg.v1_msg.send_rndis_pkt.channel_type = 0; else
} else { rpkt->channel_type = 1; /* 1 is RMC_CONTROL */
/* 1 is RMC_CONTROL; */
nvmsg.msg.v1_msg.send_rndis_pkt.channel_type = 1;
}
nvmsg.msg.v1_msg.send_rndis_pkt.send_buf_section_index = rpkt->send_buf_section_index = packet->send_buf_index;
packet->send_buf_index;
if (packet->send_buf_index == NETVSC_INVALID_INDEX) if (packet->send_buf_index == NETVSC_INVALID_INDEX)
nvmsg.msg.v1_msg.send_rndis_pkt.send_buf_section_size = 0; rpkt->send_buf_section_size = 0;
else else
nvmsg.msg.v1_msg.send_rndis_pkt.send_buf_section_size = rpkt->send_buf_section_size = packet->total_data_buflen;
packet->total_data_buflen;
req_id = (ulong)skb; req_id = (ulong)skb;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment