[dpdk-stable] patch 'lib: fix unnecessary double negation' has been queued to stable release 19.11.1

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Feb 17 18:45:05 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/19/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From 7081fd04ce3e615b815870e40a8a6cba04983c42 Mon Sep 17 00:00:00 2001
From: Ciara Power <ciara.power at intel.com>
Date: Fri, 14 Feb 2020 16:17:25 +0000
Subject: [PATCH] lib: fix unnecessary double negation

[ upstream commit f42c9ac5b6b5fabd3c6bb124914af6704445e853 ]

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")

Signed-off-by: Ciara Power <ciara.power at intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
Acked-by: Olivier Matz <olivier.matz at 6wind.com>
---
 lib/librte_mbuf/rte_mbuf.h       | 2 +-
 lib/librte_mempool/rte_mempool.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 219b110b76..6d080527f6 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -1535,7 +1535,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 0a1dc6059f..4907c0808e 100644
--- a/lib/librte_mempool/rte_mempool.h
+++ b/lib/librte_mempool/rte_mempool.h
@@ -1653,7 +1653,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;
 }
 
 /**
@@ -1672,7 +1672,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;
 }
 
 /**
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-17 17:00:15.701318588 +0000
+++ 0013-lib-fix-unnecessary-double-negation.patch	2020-02-17 17:00:15.283950115 +0000
@@ -1,14 +1,15 @@
-From f42c9ac5b6b5fabd3c6bb124914af6704445e853 Mon Sep 17 00:00:00 2001
+From 7081fd04ce3e615b815870e40a8a6cba04983c42 Mon Sep 17 00:00:00 2001
 From: Ciara Power <ciara.power at intel.com>
 Date: Fri, 14 Feb 2020 16:17:25 +0000
 Subject: [PATCH] lib: fix unnecessary double negation
 
+[ upstream commit f42c9ac5b6b5fabd3c6bb124914af6704445e853 ]
+
 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 at dpdk.org
 
 Signed-off-by: Ciara Power <ciara.power at intel.com>
 Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
@@ -19,10 +20,10 @@
  2 files changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
-index 59023893a5..34679e0920 100644
+index 219b110b76..6d080527f6 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)
+@@ -1535,7 +1535,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);
@@ -32,10 +33,10 @@
  
  /**
 diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
-index a2c92727a6..c90cf31467 100644
+index 0a1dc6059f..4907c0808e 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);
+@@ -1653,7 +1653,7 @@ rte_mempool_in_use_count(const struct rte_mempool *mp);
  static inline int
  rte_mempool_full(const struct rte_mempool *mp)
  {
@@ -44,7 +45,7 @@
  }
  
  /**
-@@ -1673,7 +1673,7 @@ rte_mempool_full(const struct rte_mempool *mp)
+@@ -1672,7 +1672,7 @@ rte_mempool_full(const struct rte_mempool *mp)
  static inline int
  rte_mempool_empty(const struct rte_mempool *mp)
  {


More information about the stable mailing list