aboutsummaryrefslogtreecommitdiffstats
path: root/net/xdp
diff options
context:
space:
mode:
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>2022-04-13 17:30:15 +0200
committerDaniel Borkmann <daniel@iogearbox.net>2022-04-15 21:11:17 +0200
commit0fb53aabc5fcdf848ec7adc777baff25a1c6c335 (patch)
treef9774e1ed74bd5cbd26af73dced3190c2845c64d /net/xdp
parentice, xsk: Avoid refilling single Rx descriptors (diff)
downloadlinux-dev-0fb53aabc5fcdf848ec7adc777baff25a1c6c335.tar.xz
linux-dev-0fb53aabc5fcdf848ec7adc777baff25a1c6c335.zip
xsk: Drop ternary operator from xskq_cons_has_entries
Simplify the mentioned helper function by removing ternary operator. The expression that is there outputs the boolean value by itself. This helper might be used in the hot path so this simplification can also be considered as micro optimization. Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20220413153015.453864-15-maciej.fijalkowski@intel.com
Diffstat (limited to 'net/xdp')
-rw-r--r--net/xdp/xsk_queue.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xdp/xsk_queue.h b/net/xdp/xsk_queue.h
index 644479e65578..a794410989cc 100644
--- a/net/xdp/xsk_queue.h
+++ b/net/xdp/xsk_queue.h
@@ -263,7 +263,7 @@ static inline u32 xskq_cons_nb_entries(struct xsk_queue *q, u32 max)
static inline bool xskq_cons_has_entries(struct xsk_queue *q, u32 cnt)
{
- return xskq_cons_nb_entries(q, cnt) >= cnt ? true : false;
+ return xskq_cons_nb_entries(q, cnt) >= cnt;
}
static inline bool xskq_cons_peek_addr_unchecked(struct xsk_queue *q, u64 *addr)