All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] bpf: Use PTR_ERR_OR_ZERO in xsk_map_inc()
@ 2019-08-20  1:36 ` YueHaibing
  0 siblings, 0 replies; 14+ messages in thread
From: YueHaibing @ 2019-08-20  1:36 UTC (permalink / raw)
  To: bjorn.topel, magnus.karlsson, jonathan.lemon, ast, daniel, kafai,
	songliubraving, yhs, john.fastabend
  Cc: YueHaibing, netdev, bpf, kernel-janitors

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 kernel/bpf/xskmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/bpf/xskmap.c b/kernel/bpf/xskmap.c
index 4cc28e226398..942c662e2eed 100644
--- a/kernel/bpf/xskmap.c
+++ b/kernel/bpf/xskmap.c
@@ -21,7 +21,7 @@ int xsk_map_inc(struct xsk_map *map)
 	struct bpf_map *m = &map->map;
 
 	m = bpf_map_inc(m, false);
-	return IS_ERR(m) ? PTR_ERR(m) : 0;
+	return PTR_ERR_OR_ZERO(m);
 }
 
 void xsk_map_put(struct xsk_map *map)




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

end of thread, other threads:[~2019-08-20 15:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-20  1:36 [PATCH -next] bpf: Use PTR_ERR_OR_ZERO in xsk_map_inc() YueHaibing
2019-08-20  1:36 ` YueHaibing
2019-08-20  7:28 ` Björn Töpel
2019-08-20  7:28   ` Björn Töpel
2019-08-20  8:55   ` Dan Carpenter
2019-08-20  8:55     ` Dan Carpenter
2019-08-20  9:25     ` Björn Töpel
2019-08-20  9:25       ` Björn Töpel
2019-08-20  9:44       ` Dan Carpenter
2019-08-20  9:44         ` Dan Carpenter
2019-08-20 11:46         ` Yuehaibing
2019-08-20 11:46           ` Yuehaibing
2019-08-20 15:09 ` Daniel Borkmann
2019-08-20 15:09   ` Daniel Borkmann

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.