Netdev List
 help / color / mirror / Atom feed
* [PATCH] xsk: fix ptr_ret.cocci warnings
       [not found] <201908201913.pObcBf2Z%lkp@intel.com>
@ 2019-08-20 11:50 ` kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-08-20 11:50 UTC (permalink / raw)
  To: =?unknown-8bit?B?QmrDtnJuIFTDtnBlbA==?=
  Cc: kbuild-all, Daniel Borkmann, Magnus Karlsson, Jonathan Lemon,
	Alexei Starovoitov, Martin KaFai Lau, Song Liu, Yonghong Song,
	netdev, bpf

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=unknown-8bit, Size: 1019 bytes --]

From: kbuild test robot <lkp@intel.com>

kernel/bpf/xskmap.c:24:8-14: WARNING: PTR_ERR_OR_ZERO can be used


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

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Fixes: 0402acd683c6 ("xsk: remove AF_XDP socket from map when the socket is released")
CC: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
---

tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next.git master
head:   54c851a8cc739ce7f1aaea583940054cdfe2223f
commit: 0402acd683c678874df6bdbc23530ca07ea19353 [7165/7710] xsk: remove AF_XDP socket from map when the socket is released

 xskmap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 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	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-20 11:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <201908201913.pObcBf2Z%lkp@intel.com>
2019-08-20 11:50 ` [PATCH] xsk: fix ptr_ret.cocci warnings kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox