summary refs log tree commit diff
path: root/net
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-05-06 15:33:06 -0600
committerDavid S. Miller <davem@davemloft.net>2020-05-06 20:03:47 -0700
commit243f2148937adc72bcaaa590d482d599c936efde (patch)
tree6313edda1c8e183fe94a4a6832c4129568baa659 /net
parent4fed818ef54b08d4b29200e416cce65546ad5312 (diff)
downloadlinux-243f2148937adc72bcaaa590d482d599c936efde.tar.gz
wireguard: send/receive: use explicit unlikely branch instead of implicit coalescing
It's very unlikely that send will become true. It's nearly always false
between 0 and 120 seconds of a session, and in most cases becomes true
only between 120 and 121 seconds before becoming false again. So,
unlikely(send) is clearly the right option here.

What happened before was that we had this complex boolean expression
with multiple likely and unlikely clauses nested. Since this is
evaluated left-to-right anyway, the whole thing got converted to
unlikely. So, we can clean this up to better represent what's going on.

The generated code is the same.

Suggested-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions