aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2025-04-04 08:53:24 -0700
committerAndrii Nakryiko <andrii@kernel.org>2025-04-04 08:53:25 -0700
commit893c3938ab5dca5c14157bd80fced95e24784931 (patch)
tree2bc06ff098a7a77679dc0b6c85d9fc8794b059af /tools/testing/selftests/bpf
parentlibbpf: Fix implicit memfd_create() for bionic (diff)
parentlibbpf: Add likely/unlikely macros and use them in selftests (diff)
downloadlinux-893c3938ab5dca5c14157bd80fced95e24784931.tar.gz
linux-893c3938ab5dca5c14157bd80fced95e24784931.zip
Merge branch 'likely-unlikely-for-bpf_helpers-and-a-small-comment-fix'
Anton Protopopov says: ==================== likely/unlikely for bpf_helpers and a small comment fix These two commits fix a comment describing bpf_attr in <linux/bpf.h> and add likely/unlikely macros to <bph/bpf_helpers.h> to be consumed by selftests and, later, by the static_branch_likely/unlikely macros. v1 -> v2: * squash libbpf and selftests fixes into one patch (Andrii) ==================== Link: https://patch.msgid.link/20250331203618.1973691-1-a.s.protopopov@gmail.com Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf')
-rw-r--r--tools/testing/selftests/bpf/bpf_arena_spin_lock.h3
-rw-r--r--tools/testing/selftests/bpf/progs/iters.c2
2 files changed, 0 insertions, 5 deletions
diff --git a/tools/testing/selftests/bpf/bpf_arena_spin_lock.h b/tools/testing/selftests/bpf/bpf_arena_spin_lock.h
index fb8dc0768999..4e29c31c4ef8 100644
--- a/tools/testing/selftests/bpf/bpf_arena_spin_lock.h
+++ b/tools/testing/selftests/bpf/bpf_arena_spin_lock.h
@@ -95,9 +95,6 @@ struct arena_qnode {
#define _Q_LOCKED_VAL (1U << _Q_LOCKED_OFFSET)
#define _Q_PENDING_VAL (1U << _Q_PENDING_OFFSET)
-#define likely(x) __builtin_expect(!!(x), 1)
-#define unlikely(x) __builtin_expect(!!(x), 0)
-
struct arena_qnode __arena qnodes[_Q_MAX_CPUS][_Q_MAX_NODES];
static inline u32 encode_tail(int cpu, int idx)
diff --git a/tools/testing/selftests/bpf/progs/iters.c b/tools/testing/selftests/bpf/progs/iters.c
index 427b72954b87..76adf4a8f2da 100644
--- a/tools/testing/selftests/bpf/progs/iters.c
+++ b/tools/testing/selftests/bpf/progs/iters.c
@@ -7,8 +7,6 @@
#include "bpf_misc.h"
#include "bpf_compiler.h"
-#define unlikely(x) __builtin_expect(!!(x), 0)
-
static volatile int zero = 0;
int my_pid;