Commit 6e9cab2e authored by Xu Wang's avatar Xu Wang Committed by Daniel Borkmann

libbpf: Simplify the return expression of build_map_pin_path()

Simplify the return expression.
Signed-off-by: default avatarXu Wang <vulab@iscas.ac.cn>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200819025324.14680-1-vulab@iscas.ac.cn
parent c1447efd
...@@ -1943,7 +1943,7 @@ static bool get_map_field_int(const char *map_name, const struct btf *btf, ...@@ -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) static int build_map_pin_path(struct bpf_map *map, const char *path)
{ {
char buf[PATH_MAX]; char buf[PATH_MAX];
int err, len; int len;
if (!path) if (!path)
path = "/sys/fs/bpf"; path = "/sys/fs/bpf";
...@@ -1954,11 +1954,7 @@ static int build_map_pin_path(struct bpf_map *map, const char *path) ...@@ -1954,11 +1954,7 @@ static int build_map_pin_path(struct bpf_map *map, const char *path)
else if (len >= PATH_MAX) else if (len >= PATH_MAX)
return -ENAMETOOLONG; return -ENAMETOOLONG;
err = bpf_map__set_pin_path(map, buf); return bpf_map__set_pin_path(map, buf);
if (err)
return err;
return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment