diff options
| author | Arnaldo Carvalho de Melo <[email protected]> | 2016-06-03 15:15:52 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2016-06-06 21:19:15 +0000 |
| commit | 6e009e65a1e5202313fdaccde3bcb94272989eba (patch) | |
| tree | 869f3325da819554f49121576743bcfe0587dacc /tools/lib/bpf/libbpf.c | |
| parent | tools lib bpf: Use IS_ERR() reporting macros with bpf_map__get_def() (diff) | |
| download | kernel-6e009e65a1e5202313fdaccde3bcb94272989eba.tar.gz kernel-6e009e65a1e5202313fdaccde3bcb94272989eba.zip | |
tools lib bpf: Rename bpf_map__get_fd() to bpf_map__fd()
For consistency, leaving "get" for reference counting.
Acked-by: Wang Nan <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Milian Wolff <[email protected]>
Cc: Namhyung Kim <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
| -rw-r--r-- | tools/lib/bpf/libbpf.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 215be67f038b..57924db2d16f 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -1311,12 +1311,9 @@ int bpf_program__nth_fd(struct bpf_program *prog, int n) return fd; } -int bpf_map__get_fd(struct bpf_map *map) +int bpf_map__fd(struct bpf_map *map) { - if (!map) - return -EINVAL; - - return map->fd; + return map ? map->fd : -EINVAL; } const struct bpf_map_def *bpf_map__def(struct bpf_map *map) |
