summaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/cfg.c
diff options
context:
space:
mode:
authorQuentin Monnet <quentin@isovalent.com>2020-05-11 17:15:33 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2020-05-11 21:20:46 +0200
commit6e7e034e88e8e22cb14765c86da92416017e45b8 (patch)
treea51838934255b07523f0eaf6517713ff7c92a99f /tools/bpf/bpftool/cfg.c
parent385bbf7b119a4feb6d6bcf3586f1bb1dd9c5b0a0 (diff)
tools, bpftool: Poison and replace kernel integer typedefs
Replace the use of kernel-only integer typedefs (u8, u32, etc.) by their user space counterpart (__u8, __u32, etc.). Similarly to what libbpf does, poison the typedefs to avoid introducing them again in the future. Signed-off-by: Quentin Monnet <quentin@isovalent.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20200511161536.29853-2-quentin@isovalent.com
Diffstat (limited to 'tools/bpf/bpftool/cfg.c')
-rw-r--r--tools/bpf/bpftool/cfg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/bpf/bpftool/cfg.c b/tools/bpf/bpftool/cfg.c
index 3e21f994f262..1951219a9af7 100644
--- a/tools/bpf/bpftool/cfg.c
+++ b/tools/bpf/bpftool/cfg.c
@@ -157,7 +157,7 @@ static bool cfg_partition_funcs(struct cfg *cfg, struct bpf_insn *cur,
return false;
}
-static bool is_jmp_insn(u8 code)
+static bool is_jmp_insn(__u8 code)
{
return BPF_CLASS(code) == BPF_JMP || BPF_CLASS(code) == BPF_JMP32;
}
@@ -176,7 +176,7 @@ static bool func_partition_bb_head(struct func_node *func)
for (; cur <= end; cur++) {
if (is_jmp_insn(cur->code)) {
- u8 opcode = BPF_OP(cur->code);
+ __u8 opcode = BPF_OP(cur->code);
if (opcode == BPF_EXIT || opcode == BPF_CALL)
continue;