bpftool: remove function free_btf_vmlinux()
authorSahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
Sun, 20 Nov 2022 11:26:43 +0000 (11:26 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 21 Nov 2022 00:17:46 +0000 (16:17 -0800)
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>
tools/bpf/bpftool/map.c

index eb362bd3d2c9a104328b52076fb477deb4800827..88911d3aa2d9c7cd0b701d3fc0cfc2300cc43568 100644 (file)
@@ -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)
@@ -952,7 +947,7 @@ exit_close:
                close(fds[i]);
 exit_free:
        free(fds);
-       free_btf_vmlinux();
+       btf__free(btf_vmlinux);
        return err;
 }