From: Pablo de Lara Date: Mon, 15 Dec 2014 13:41:46 +0000 (+0000) Subject: ring: fix return type in enqueue and dequeue burst functions X-Git-Tag: spdx-start~9940 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b443307ad3c5cff2957c00338eaf3239261801f1;p=dpdk.git ring: fix return type in enqueue and dequeue burst functions Enqueue and dequeue burst functions always return a positive value (including 0), so return type should be unsigned, instead of int. Fixed also API doc for one of the functions. Signed-off-by: Pablo de Lara Acked-by: Olivier Matz --- diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h index 39208305c6..7cd5f2d41c 100644 --- a/lib/librte_ring/rte_ring.h +++ b/lib/librte_ring/rte_ring.h @@ -1087,7 +1087,7 @@ struct rte_ring *rte_ring_lookup(const char *name); * @return * - n: Actual number of objects enqueued. */ -static inline int __attribute__((always_inline)) +static inline unsigned __attribute__((always_inline)) rte_ring_mp_enqueue_burst(struct rte_ring *r, void * const *obj_table, unsigned n) { @@ -1106,7 +1106,7 @@ rte_ring_mp_enqueue_burst(struct rte_ring *r, void * const *obj_table, * @return * - n: Actual number of objects enqueued. */ -static inline int __attribute__((always_inline)) +static inline unsigned __attribute__((always_inline)) rte_ring_sp_enqueue_burst(struct rte_ring *r, void * const *obj_table, unsigned n) { @@ -1129,7 +1129,7 @@ rte_ring_sp_enqueue_burst(struct rte_ring *r, void * const *obj_table, * @return * - n: Actual number of objects enqueued. */ -static inline int __attribute__((always_inline)) +static inline unsigned __attribute__((always_inline)) rte_ring_enqueue_burst(struct rte_ring *r, void * const *obj_table, unsigned n) { @@ -1156,7 +1156,7 @@ rte_ring_enqueue_burst(struct rte_ring *r, void * const *obj_table, * @return * - n: Actual number of objects dequeued, 0 if ring is empty */ -static inline int __attribute__((always_inline)) +static inline unsigned __attribute__((always_inline)) rte_ring_mc_dequeue_burst(struct rte_ring *r, void **obj_table, unsigned n) { return __rte_ring_mc_do_dequeue(r, obj_table, n, RTE_RING_QUEUE_VARIABLE); @@ -1176,7 +1176,7 @@ rte_ring_mc_dequeue_burst(struct rte_ring *r, void **obj_table, unsigned n) * @return * - n: Actual number of objects dequeued, 0 if ring is empty */ -static inline int __attribute__((always_inline)) +static inline unsigned __attribute__((always_inline)) rte_ring_sc_dequeue_burst(struct rte_ring *r, void **obj_table, unsigned n) { return __rte_ring_sc_do_dequeue(r, obj_table, n, RTE_RING_QUEUE_VARIABLE); @@ -1196,9 +1196,9 @@ rte_ring_sc_dequeue_burst(struct rte_ring *r, void **obj_table, unsigned n) * @param n * The number of objects to dequeue from the ring to the obj_table. * @return - * - Number of objects dequeued, or a negative error code on error + * - Number of objects dequeued */ -static inline int __attribute__((always_inline)) +static inline unsigned __attribute__((always_inline)) rte_ring_dequeue_burst(struct rte_ring *r, void **obj_table, unsigned n) { if (r->cons.sc_dequeue)