OSDN Git Service

bpf: Use PTR_ERR_OR_ZERO in xsk_map_inc()
authorYueHaibing <yuehaibing@huawei.com>
Tue, 20 Aug 2019 01:36:52 +0000 (01:36 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 20 Aug 2019 14:03:52 +0000 (16:03 +0200)
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>
kernel/bpf/xskmap.c

index 4cc28e2..942c662 100644 (file)
@@ -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)