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>
This commit is contained in:
parent
1f72672327
commit
ede6bc88d6
|
@ -21,7 +21,7 @@ int xsk_map_inc(struct xsk_map *map)
|
||||||
struct bpf_map *m = &map->map;
|
struct bpf_map *m = &map->map;
|
||||||
|
|
||||||
m = bpf_map_inc(m, false);
|
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)
|
void xsk_map_put(struct xsk_map *map)
|
||||||
|
|
Loading…
Reference in New Issue