bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] libbpf: simplify the return expression of build_map_pin_path()
@ 2020-08-19  2:53 Xu Wang
  2020-08-19  4:15 ` Yonghong Song
  2020-08-20 14:18 ` Daniel Borkmann
  0 siblings, 2 replies; 3+ messages in thread
From: Xu Wang @ 2020-08-19  2:53 UTC (permalink / raw)
  To: ast, daniel, kafai, songliubraving, yhs, andriin, john.fastabend,
	kpsingh, netdev, bpf
  Cc: linux-kernel, Xu Wang

Simplify the return expression.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
 tools/lib/bpf/libbpf.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 5d20b2da4427..cd59e237ca96 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -1924,7 +1924,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";
@@ -1935,11 +1935,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);
 }
 
 
-- 
2.17.1


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

* Re: [PATCH bpf-next] libbpf: simplify the return expression of build_map_pin_path()
  2020-08-19  2:53 [PATCH bpf-next] libbpf: simplify the return expression of build_map_pin_path() Xu Wang
@ 2020-08-19  4:15 ` Yonghong Song
  2020-08-20 14:18 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Yonghong Song @ 2020-08-19  4:15 UTC (permalink / raw)
  To: Xu Wang, ast, daniel, kafai, songliubraving, andriin,
	john.fastabend, kpsingh, netdev, bpf
  Cc: linux-kernel



On 8/18/20 7:53 PM, Xu Wang wrote:
> Simplify the return expression.
> 
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>

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 build_map_pin_path()
  2020-08-19  2:53 [PATCH bpf-next] libbpf: simplify the return expression of build_map_pin_path() Xu Wang
  2020-08-19  4:15 ` Yonghong Song
@ 2020-08-20 14:18 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2020-08-20 14:18 UTC (permalink / raw)
  To: Xu Wang, ast, kafai, songliubraving, yhs, andriin,
	john.fastabend, kpsingh, netdev, bpf
  Cc: linux-kernel

On 8/19/20 4:53 AM, Xu Wang wrote:
> Simplify the return expression.
> 
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>

Applied, thanks!

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

end of thread, other threads:[~2020-08-20 14:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-19  2:53 [PATCH bpf-next] libbpf: simplify the return expression of build_map_pin_path() Xu Wang
2020-08-19  4:15 ` Yonghong Song
2020-08-20 14:18 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).