Commit da60cf00 authored by Björn Töpel's avatar Björn Töpel Committed by Daniel Borkmann

xsk: fixed some cases of unnecessary parentheses

Removed some cases of unnecessary parentheses.
Signed-off-by: default avatarBjörn Töpel <bjorn.topel@intel.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 54b85c27
...@@ -20,7 +20,7 @@ int xdp_umem_create(struct xdp_umem **umem) ...@@ -20,7 +20,7 @@ int xdp_umem_create(struct xdp_umem **umem)
{ {
*umem = kzalloc(sizeof(**umem), GFP_KERNEL); *umem = kzalloc(sizeof(**umem), GFP_KERNEL);
if (!(*umem)) if (!*umem)
return -ENOMEM; return -ENOMEM;
return 0; return 0;
...@@ -247,5 +247,5 @@ int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr) ...@@ -247,5 +247,5 @@ int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)
bool xdp_umem_validate_queues(struct xdp_umem *umem) bool xdp_umem_validate_queues(struct xdp_umem *umem)
{ {
return (umem->fq && umem->cq); return umem->fq && umem->cq;
} }
...@@ -22,8 +22,7 @@ static u32 xskq_umem_get_ring_size(struct xsk_queue *q) ...@@ -22,8 +22,7 @@ static u32 xskq_umem_get_ring_size(struct xsk_queue *q)
static u32 xskq_rxtx_get_ring_size(struct xsk_queue *q) static u32 xskq_rxtx_get_ring_size(struct xsk_queue *q)
{ {
return (sizeof(struct xdp_ring) + return sizeof(struct xdp_ring) + q->nentries * sizeof(struct xdp_desc);
q->nentries * sizeof(struct xdp_desc));
} }
struct xsk_queue *xskq_create(u32 nentries, bool umem_queue) struct xsk_queue *xskq_create(u32 nentries, bool umem_queue)
......
...@@ -223,12 +223,12 @@ static inline void xskq_produce_flush_desc(struct xsk_queue *q) ...@@ -223,12 +223,12 @@ static inline void xskq_produce_flush_desc(struct xsk_queue *q)
static inline bool xskq_full_desc(struct xsk_queue *q) static inline bool xskq_full_desc(struct xsk_queue *q)
{ {
return (xskq_nb_avail(q, q->nentries) == q->nentries); return xskq_nb_avail(q, q->nentries) == q->nentries;
} }
static inline bool xskq_empty_desc(struct xsk_queue *q) static inline bool xskq_empty_desc(struct xsk_queue *q)
{ {
return (xskq_nb_free(q, q->prod_tail, 1) == q->nentries); return xskq_nb_free(q, q->prod_tail, 1) == q->nentries;
} }
void xskq_set_umem(struct xsk_queue *q, struct xdp_umem_props *umem_props); void xskq_set_umem(struct xsk_queue *q, struct xdp_umem_props *umem_props);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment