Skip to content

Commit 0fb53aa

Browse files
mfijalkoborkmann
authored andcommitted
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 <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 4efad19 commit 0fb53aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/xdp/xsk_queue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ static inline u32 xskq_cons_nb_entries(struct xsk_queue *q, u32 max)
263263

264264
static inline bool xskq_cons_has_entries(struct xsk_queue *q, u32 cnt)
265265
{
266-
return xskq_cons_nb_entries(q, cnt) >= cnt ? true : false;
266+
return xskq_cons_nb_entries(q, cnt) >= cnt;
267267
}
268268

269269
static inline bool xskq_cons_peek_addr_unchecked(struct xsk_queue *q, u64 *addr)

0 commit comments

Comments
 (0)