Skip to content

Commit 8fc5b95

Browse files
Yonghong SongKernel Patches Daemon
authored andcommitted
libbpf: Mark libbpf_kallsyms_parse static function
Currently libbpf_kallsyms_parse() function is declared as a global function but actually it is not a API and there is no external users in bpftool/bpf-selftests. So let us mark the function as static. Signed-off-by: Yonghong Song <[email protected]>
1 parent 37d7d05 commit 8fc5b95

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

tools/lib/bpf/libbpf.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7982,7 +7982,10 @@ static int bpf_object__sanitize_maps(struct bpf_object *obj)
79827982
return 0;
79837983
}
79847984

7985-
int libbpf_kallsyms_parse(kallsyms_cb_t cb, void *ctx)
7985+
typedef int (*kallsyms_cb_t)(unsigned long long sym_addr, char sym_type,
7986+
const char *sym_name, void *ctx);
7987+
7988+
static int libbpf_kallsyms_parse(kallsyms_cb_t cb, void *ctx)
79867989
{
79877990
char sym_type, sym_name[500];
79887991
unsigned long long sym_addr;

tools/lib/bpf/libbpf_internal.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,6 @@ int btf_ext_visit_str_offs(struct btf_ext *btf_ext, str_off_visit_fn visit, void
518518
__s32 btf__find_by_name_kind_own(const struct btf *btf, const char *type_name,
519519
__u32 kind);
520520

521-
typedef int (*kallsyms_cb_t)(unsigned long long sym_addr, char sym_type,
522-
const char *sym_name, void *ctx);
523-
524-
int libbpf_kallsyms_parse(kallsyms_cb_t cb, void *arg);
525-
526521
/* handle direct returned errors */
527522
static inline int libbpf_err(int ret)
528523
{

0 commit comments

Comments
 (0)