Skip to content

Commit

Permalink
bpftool: remove function free_btf_vmlinux()
Browse files Browse the repository at this point in the history
The function contains a single btf__free() call which can be
inlined. Credits to Yonghong Song.

Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
Acked-by: Yonghong Song <yhs@fb.com>
Suggested-by: Yonghong Song <yhs@fb.com>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/r/20221120112515.38165-6-sahid.ferdjaoui@industrialdiscipline.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
  • Loading branch information
Sahid Orentino Ferdjaoui authored and Alexei Starovoitov committed Nov 21, 2022
1 parent d1313e0 commit 52df1a8
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tools/bpf/bpftool/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,11 +811,6 @@ static void free_map_kv_btf(struct btf *btf)
btf__free(btf);
}

static void free_btf_vmlinux(void)
{
btf__free(btf_vmlinux);
}

static int
map_dump(int fd, struct bpf_map_info *info, json_writer_t *wtr,
bool show_header)
Expand Down Expand Up @@ -952,7 +947,7 @@ static int do_dump(int argc, char **argv)
close(fds[i]);
exit_free:
free(fds);
free_btf_vmlinux();
btf__free(btf_vmlinux);
return err;
}

Expand Down

0 comments on commit 52df1a8

Please sign in to comment.