From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wiles, Roger Keith" Subject: [PATCH] Remove n_orig from __mempool_get_bulk() routine, cleanup comment. Date: Fri, 3 Oct 2014 21:27:59 +0000 Message-ID: <1EEE2DAF-2F00-4B95-A1ED-262FA9E00077@windriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable To: "" Return-path: Content-Language: en-US Content-ID: <3B4CAF98FE8B694989D08C943674EA29@local> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Cleanup the code some to remove n_orig variable that was not required. = =20 Update the comments to __mempool_get_bulk to state the correct return value= . =20 Signed-off-by: Keith Wiles = =20 --- = =20 lib/librte_mempool/rte_mempool.h | 11 ++++------- = =20 1 file changed, 4 insertions(+), 7 deletions(-) = =20 diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_memp= ool.h index 95f19f9..597cf4f 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h @@ -937,7 +937,7 @@ rte_mempool_put(struct rte_mempool *mp, void *obj) * @param is_mc * Mono-consumer (0) or multi-consumers (1). * @return - * - >=3D0: Success; number of objects supplied. + * - 0: Success; number of objects requested. * - <0: Error; code of ring dequeue function. */ static inline int __attribute__((always_inline)) @@ -945,9 +945,6 @@ __mempool_get_bulk(struct rte_mempool *mp, void **obj_t= able, unsigned n, int is_mc) { int ret; -#ifdef RTE_LIBRTE_MEMPOOL_DEBUG - unsigned n_orig =3D n; -#endif #if RTE_MEMPOOL_CACHE_MAX_SIZE > 0 struct rte_mempool_cache *cache; uint32_t index, len; @@ -988,7 +985,7 @@ __mempool_get_bulk(struct rte_mempool *mp, void **obj_t= able, =20 cache->len -=3D n; =20 - __MEMPOOL_STAT_ADD(mp, get_success, n_orig); + __MEMPOOL_STAT_ADD(mp, get_success, n); =20 return 0; =20 @@ -1002,9 +999,9 @@ ring_dequeue: ret =3D rte_ring_sc_dequeue_bulk(mp->ring, obj_table, n); =20 if (ret < 0) - __MEMPOOL_STAT_ADD(mp, get_fail, n_orig); + __MEMPOOL_STAT_ADD(mp, get_fail, n); else - __MEMPOOL_STAT_ADD(mp, get_success, n_orig); + __MEMPOOL_STAT_ADD(mp, get_success, n); =20 return ret; } --=20 2.1.0 Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-= 213-5533