Skip to content

Commit

Permalink
xsk: fixed some cases of unnecessary parentheses
Browse files Browse the repository at this point in the history
Removed some cases of unnecessary parentheses.

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
Björn Töpel authored and Daniel Borkmann committed May 18, 2018
1 parent 54b85c2 commit da60cf0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions net/xdp/xdp_umem.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int xdp_umem_create(struct xdp_umem **umem)
{
*umem = kzalloc(sizeof(**umem), GFP_KERNEL);

if (!(*umem))
if (!*umem)
return -ENOMEM;

return 0;
Expand Down Expand Up @@ -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)
{
return (umem->fq && umem->cq);
return umem->fq && umem->cq;
}
3 changes: 1 addition & 2 deletions net/xdp/xsk_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
return (sizeof(struct xdp_ring) +
q->nentries * sizeof(struct xdp_desc));
return sizeof(struct xdp_ring) + q->nentries * sizeof(struct xdp_desc);
}

struct xsk_queue *xskq_create(u32 nentries, bool umem_queue)
Expand Down
4 changes: 2 additions & 2 deletions net/xdp/xsk_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
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)
{
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);
Expand Down

0 comments on commit da60cf0

Please sign in to comment.