Commit 3b3af91c authored by Wang Hai's avatar Wang Hai Committed by Andrii Nakryiko

libbpf: Simplify the return expression of bpf_object__init_maps function

There is no need for special treatment of the 'ret == 0' case.
This patch simplifies the return expression.
Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20210609115651.3392580-1-wanghai38@huawei.com
parent 380afe72
...@@ -2465,10 +2465,8 @@ static int bpf_object__init_maps(struct bpf_object *obj, ...@@ -2465,10 +2465,8 @@ static int bpf_object__init_maps(struct bpf_object *obj,
err = err ?: bpf_object__init_global_data_maps(obj); err = err ?: bpf_object__init_global_data_maps(obj);
err = err ?: bpf_object__init_kconfig_map(obj); err = err ?: bpf_object__init_kconfig_map(obj);
err = err ?: bpf_object__init_struct_ops_maps(obj); err = err ?: bpf_object__init_struct_ops_maps(obj);
if (err)
return err;
return 0; return err;
} }
static bool section_have_execinstr(struct bpf_object *obj, int idx) static bool section_have_execinstr(struct bpf_object *obj, int idx)
......
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