summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorXu Wang <vulab@iscas.ac.cn>2020-08-19 02:53:24 +0000
committerDaniel Borkmann <daniel@iogearbox.net>2020-08-20 16:01:10 +0200
commit6e9cab2e3fa597419ec8a117a9f3e3ebc251c120 (patch)
tree64fcb5fea8464e0a07075efdb1627bdc45a8dc7c /tools/lib
parentc1447efdafff23eae9b1bd81caa38412ae21410e (diff)
downloadlinux-stable-6e9cab2e3fa597419ec8a117a9f3e3ebc251c120.tar.gz
linux-stable-6e9cab2e3fa597419ec8a117a9f3e3ebc251c120.tar.bz2
linux-stable-6e9cab2e3fa597419ec8a117a9f3e3ebc251c120.zip
libbpf: Simplify the return expression of build_map_pin_path()
Simplify the return expression. Signed-off-by: Xu Wang <vulab@iscas.ac.cn> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20200819025324.14680-1-vulab@iscas.ac.cn
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/bpf/libbpf.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 77d420c02094..829d62a3ad5f 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -1943,7 +1943,7 @@ static bool get_map_field_int(const char *map_name, const struct btf *btf,
static int build_map_pin_path(struct bpf_map *map, const char *path)
{
char buf[PATH_MAX];
- int err, len;
+ int len;
if (!path)
path = "/sys/fs/bpf";
@@ -1954,11 +1954,7 @@ static int build_map_pin_path(struct bpf_map *map, const char *path)
else if (len >= PATH_MAX)
return -ENAMETOOLONG;
- err = bpf_map__set_pin_path(map, buf);
- if (err)
- return err;
-
- return 0;
+ return bpf_map__set_pin_path(map, buf);
}