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

netvsc: mark error cases as unlikely

Mark if() statements used for error handling only as unlikely()
Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2d05b560
...@@ -855,14 +855,14 @@ int netvsc_send(struct hv_device *device, ...@@ -855,14 +855,14 @@ int netvsc_send(struct hv_device *device,
bool xmit_more = (skb != NULL) ? skb->xmit_more : false; bool xmit_more = (skb != NULL) ? skb->xmit_more : false;
net_device = get_outbound_net_device(device); net_device = get_outbound_net_device(device);
if (!net_device) if (unlikely(!net_device))
return -ENODEV; return -ENODEV;
/* We may race with netvsc_connect_vsp()/netvsc_init_buf() and get /* We may race with netvsc_connect_vsp()/netvsc_init_buf() and get
* here before the negotiation with the host is finished and * here before the negotiation with the host is finished and
* send_section_map may not be allocated yet. * send_section_map may not be allocated yet.
*/ */
if (!net_device->send_section_map) if (unlikely(!net_device->send_section_map))
return -EAGAIN; return -EAGAIN;
nvchan = &net_device->chan_table[packet->q_idx]; nvchan = &net_device->chan_table[packet->q_idx];
......
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