Skip to content

Commit 2d694d2

Browse files
shemmingerdavem330
authored andcommitted
netvsc: mark error cases as unlikely
Mark if() statements used for error handling only as unlikely() Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2d05b56 commit 2d694d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/hyperv/netvsc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,14 +855,14 @@ int netvsc_send(struct hv_device *device,
855855
bool xmit_more = (skb != NULL) ? skb->xmit_more : false;
856856

857857
net_device = get_outbound_net_device(device);
858-
if (!net_device)
858+
if (unlikely(!net_device))
859859
return -ENODEV;
860860

861861
/* We may race with netvsc_connect_vsp()/netvsc_init_buf() and get
862862
* here before the negotiation with the host is finished and
863863
* send_section_map may not be allocated yet.
864864
*/
865-
if (!net_device->send_section_map)
865+
if (unlikely(!net_device->send_section_map))
866866
return -EAGAIN;
867867

868868
nvchan = &net_device->chan_table[packet->q_idx];

0 commit comments

Comments
 (0)