Commit ebc1dcf6 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

netvsc: eliminate unnecessary skb == NULL checks

Since there already is a special case goto for control messages (skb == NULL)
in netvsc_send, there is no need for later checks in same code path.
Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 00ecfb3b
...@@ -706,8 +706,7 @@ static u32 netvsc_copy_to_send_buf(struct netvsc_device *net_device, ...@@ -706,8 +706,7 @@ static u32 netvsc_copy_to_send_buf(struct netvsc_device *net_device,
packet->page_buf_cnt; packet->page_buf_cnt;
/* Add padding */ /* Add padding */
if (skb && skb->xmit_more && remain && if (skb->xmit_more && remain && !packet->cp_partial) {
!packet->cp_partial) {
padding = net_device->pkt_align - remain; padding = net_device->pkt_align - remain;
rndis_msg->msg_len += padding; rndis_msg->msg_len += padding;
packet->total_data_buflen += padding; packet->total_data_buflen += padding;
...@@ -865,9 +864,7 @@ int netvsc_send(struct hv_device *device, ...@@ -865,9 +864,7 @@ int netvsc_send(struct hv_device *device,
if (msdp->pkt) if (msdp->pkt)
msd_len = msdp->pkt->total_data_buflen; msd_len = msdp->pkt->total_data_buflen;
try_batch = (skb != NULL) && msd_len > 0 && msdp->count < try_batch = msd_len > 0 && msdp->count < net_device->max_pkt;
net_device->max_pkt;
if (try_batch && msd_len + pktlen + net_device->pkt_align < if (try_batch && msd_len + pktlen + net_device->pkt_align <
net_device->send_section_size) { net_device->send_section_size) {
section_index = msdp->pkt->send_buf_index; section_index = msdp->pkt->send_buf_index;
...@@ -877,7 +874,7 @@ int netvsc_send(struct hv_device *device, ...@@ -877,7 +874,7 @@ int netvsc_send(struct hv_device *device,
section_index = msdp->pkt->send_buf_index; section_index = msdp->pkt->send_buf_index;
packet->cp_partial = true; packet->cp_partial = true;
} else if ((skb != NULL) && pktlen + net_device->pkt_align < } else if (pktlen + net_device->pkt_align <
net_device->send_section_size) { net_device->send_section_size) {
section_index = netvsc_get_next_send_section(net_device); section_index = netvsc_get_next_send_section(net_device);
if (section_index != NETVSC_INVALID_INDEX) { if (section_index != NETVSC_INVALID_INDEX) {
......
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