summaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/prog.c
diff options
context:
space:
mode:
authorQuentin Monnet2018-12-14 14:56:01 +0100
committerDaniel Borkmann2018-12-15 01:31:49 +0100
commitc101189bc9680675a2686bafe908015a07a0da51 (patch)
tree65178d436002e69009993778078eb7c2e1a8940e /tools/bpf/bpftool/prog.c
parenttools: bpftool: fix warning on struct bpf_prog_linfo definition (diff)
downloadkernel-qcow2-linux-c101189bc9680675a2686bafe908015a07a0da51.tar.gz
kernel-qcow2-linux-c101189bc9680675a2686bafe908015a07a0da51.tar.xz
kernel-qcow2-linux-c101189bc9680675a2686bafe908015a07a0da51.zip
tools: bpftool: fix -Wmissing declaration warnings
Help compiler check arguments for several utility functions used to print items to the console by adding the "printf" attribute when declaring those functions. Also, declare as "static" two functions that are only used in prog.c. All of them discovered by compiling bpftool with -Wmissing-format-attribute -Wmissing-declarations. Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
-rw-r--r--tools/bpf/bpftool/prog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
index ee51279be9c7..2d1bb7d6ff51 100644
--- a/tools/bpf/bpftool/prog.c
+++ b/tools/bpf/bpftool/prog.c
@@ -32,7 +32,7 @@ static const char * const attach_type_strings[] = {
[__MAX_BPF_ATTACH_TYPE] = NULL,
};
-enum bpf_attach_type parse_attach_type(const char *str)
+static enum bpf_attach_type parse_attach_type(const char *str)
{
enum bpf_attach_type type;
@@ -798,7 +798,7 @@ struct map_replace {
char *name;
};
-int map_replace_compar(const void *p1, const void *p2)
+static int map_replace_compar(const void *p1, const void *p2)
{
const struct map_replace *a = p1, *b = p2;