libbpf: simplify the return expression of bpf_object__init_maps function
Subsystems (4)
PATCH 1/1 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 Wang Hai <[email protected]>
--- tools/lib/bpf/libbpf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
tools/lib/bpf/libbpf.c +1 -3
@@ -2425,10 +2425,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_kconfig_map (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)
Signature · 1 line
2.17.1
Quoted 4 lines · Wang Hai
There is no need for special treatment of the 'ret == 0' case. This patch simplifies the return expression.
Signed-off-by Wang Hai <[email protected]>
Acked-by Yonghong Song <[email protected]>
Andrii Nakryiko
AppliedQuoted 10 lines · Yonghong Song
Quoted 4 lines · Wang Hai
There is no need for special treatment of the 'ret == 0' case. This patch simplifies the return expression.
Signed-off-by Wang Hai <[email protected]>Acked-by Yonghong Song <[email protected]>
Applied to bpf-next a few days ago. Seems like patchbot was off duty at that time.