All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] libbpf: simplify the return expression of bpf_object__init_maps function
@ 2021-06-09 11:56 Wang Hai
  2021-06-09 15:20 ` Yonghong Song
  0 siblings, 1 reply; 3+ messages in thread
From: Wang Hai @ 2021-06-09 11:56 UTC (permalink / raw)
  To: davem, kuba, ast, daniel, andrii, kafai, songliubraving, yhs,
	john.fastabend, kpsingh
  Cc: bpf, netdev, linux-kernel

There is no need for special treatment of the 'ret == 0' case.
This patch simplifies the return expression.

Signed-off-by: Wang Hai <wanghai38@huawei.com>
---
 tools/lib/bpf/libbpf.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index c41d9b2b59ac..e49fcac45fdc 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -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)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] libbpf: simplify the return expression of bpf_object__init_maps function
  2021-06-09 11:56 [PATCH bpf-next] libbpf: simplify the return expression of bpf_object__init_maps function Wang Hai
@ 2021-06-09 15:20 ` Yonghong Song
  2021-06-15  6:24   ` Andrii Nakryiko
  0 siblings, 1 reply; 3+ messages in thread
From: Yonghong Song @ 2021-06-09 15:20 UTC (permalink / raw)
  To: Wang Hai, davem, kuba, ast, daniel, andrii, kafai,
	songliubraving, john.fastabend, kpsingh
  Cc: bpf, netdev, linux-kernel



On 6/9/21 4:56 AM, Wang Hai wrote:
> There is no need for special treatment of the 'ret == 0' case.
> This patch simplifies the return expression.
> 
> Signed-off-by: Wang Hai <wanghai38@huawei.com>

Acked-by: Yonghong Song <yhs@fb.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] libbpf: simplify the return expression of bpf_object__init_maps function
  2021-06-09 15:20 ` Yonghong Song
@ 2021-06-15  6:24   ` Andrii Nakryiko
  0 siblings, 0 replies; 3+ messages in thread
From: Andrii Nakryiko @ 2021-06-15  6:24 UTC (permalink / raw)
  To: Yonghong Song
  Cc: Wang Hai, David S. Miller, Jakub Kicinski, Alexei Starovoitov,
	Daniel Borkmann, Andrii Nakryiko, Martin Lau, Song Liu,
	john fastabend, KP Singh, bpf, Networking, open list

On Wed, Jun 9, 2021 at 8:21 AM Yonghong Song <yhs@fb.com> wrote:
>
>
>
> On 6/9/21 4:56 AM, Wang Hai wrote:
> > There is no need for special treatment of the 'ret == 0' case.
> > This patch simplifies the return expression.
> >
> > Signed-off-by: Wang Hai <wanghai38@huawei.com>
>
> Acked-by: Yonghong Song <yhs@fb.com>

Applied to bpf-next a few days ago. Seems like patchbot was off duty
at that time.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-15  6:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 11:56 [PATCH bpf-next] libbpf: simplify the return expression of bpf_object__init_maps function Wang Hai
2021-06-09 15:20 ` Yonghong Song
2021-06-15  6:24   ` Andrii Nakryiko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.