diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-06-02 11:02:05 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-06-06 18:18:44 -0300 |
commit | 009ad5d5945697a887f0c1b2d581503d92dcde6f (patch) | |
tree | 362661bc8c4ed550eda5d52adc04752a1bace8c6 /tools/lib | |
parent | b4cbfa5670414a567a8a3b368047538f522eff6a (diff) | |
download | linux-009ad5d5945697a887f0c1b2d581503d92dcde6f.tar.bz2 |
tools lib bpf: Rename bpf_map__get_name() to bpf_map__name()
For consistency, leaving "get" for reference counting.
Acked-by: Wang Nan <wangnan0@huawei.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/n/tip-crnflv84ejyhpba933ec71gs@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/bpf/libbpf.c | 6 | ||||
-rw-r--r-- | tools/lib/bpf/libbpf.h | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 9bba1a907abe..4dc617befd13 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -1328,11 +1328,9 @@ int bpf_map__get_def(struct bpf_map *map, struct bpf_map_def *pdef) return 0; } -const char *bpf_map__get_name(struct bpf_map *map) +const char *bpf_map__name(struct bpf_map *map) { - if (!map) - return NULL; - return map->name; + return map ? map->name : NULL; } int bpf_map__set_private(struct bpf_map *map, void *priv, diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h index 916abf971249..f8fbba4ccef3 100644 --- a/tools/lib/bpf/libbpf.h +++ b/tools/lib/bpf/libbpf.h @@ -182,7 +182,7 @@ bpf_map__next(struct bpf_map *map, struct bpf_object *obj); int bpf_map__get_fd(struct bpf_map *map); int bpf_map__get_def(struct bpf_map *map, struct bpf_map_def *pdef); -const char *bpf_map__get_name(struct bpf_map *map); +const char *bpf_map__name(struct bpf_map *map); typedef void (*bpf_map_clear_priv_t)(struct bpf_map *, void *); int bpf_map__set_private(struct bpf_map *map, void *priv, |