From: Ciara Power Date: Fri, 14 Feb 2020 16:17:25 +0000 (+0000) Subject: lib: fix unnecessary double negation X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=f42c9ac5b6b5fabd3c6bb124914af6704445e853 lib: fix unnecessary double negation An equality expression already returns either 0 or 1. There is no need to use double negation for these cases. Fixes: ea672a8b1655 ("mbuf: remove the rte_pktmbuf structure") Fixes: a0fd91cefcc0 ("mempool: rename functions with confusing names") Cc: stable@dpdk.org Signed-off-by: Ciara Power Reviewed-by: Ferruh Yigit Acked-by: Olivier Matz --- diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 59023893a5..34679e0920 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -1699,7 +1699,7 @@ static inline int rte_pktmbuf_trim(struct rte_mbuf *m, uint16_t len) static inline int rte_pktmbuf_is_contiguous(const struct rte_mbuf *m) { __rte_mbuf_sanity_check(m, 1); - return !!(m->nb_segs == 1); + return m->nb_segs == 1; } /** diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h index a2c92727a6..c90cf31467 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h @@ -1654,7 +1654,7 @@ rte_mempool_in_use_count(const struct rte_mempool *mp); static inline int rte_mempool_full(const struct rte_mempool *mp) { - return !!(rte_mempool_avail_count(mp) == mp->size); + return rte_mempool_avail_count(mp) == mp->size; } /** @@ -1673,7 +1673,7 @@ rte_mempool_full(const struct rte_mempool *mp) static inline int rte_mempool_empty(const struct rte_mempool *mp) { - return !!(rte_mempool_avail_count(mp) == 0); + return rte_mempool_avail_count(mp) == 0; } /**