aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-08-20 01:36:52 +0000
committerDaniel Borkmann <daniel@iogearbox.net>2019-08-20 16:03:52 +0200
commitede6bc88d6bbe16a938de2b00f60f4e03768c988 (patch)
tree5f5343ea1f682eb7f73b6cd476e005115d98a985 /kernel
parentMerge branch 'bpf-af-xdp-xskmap-improvements' (diff)
downloadlinux-dev-ede6bc88d6bbe16a938de2b00f60f4e03768c988.tar.xz
linux-dev-ede6bc88d6bbe16a938de2b00f60f4e03768c988.zip
bpf: Use PTR_ERR_OR_ZERO in xsk_map_inc()
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Björn Töpel <bjorn.topel@intel.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/bpf/xskmap.c2
1 files changed, 1 insertions, 1 deletions
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)