From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82]) by dpdk.org (Postfix) with ESMTP id 740391C106 for ; Fri, 11 May 2018 03:59:43 +0200 (CEST) From: Andy Green To: dev@dpdk.org Date: Fri, 11 May 2018 09:59:39 +0800 Message-ID: <152600397975.54839.7981692414118296901.stgit@localhost.localdomain> In-Reply-To: <152600382101.54839.18392182958431211001.stgit@localhost.localdomain> References: <152600382101.54839.18392182958431211001.stgit@localhost.localdomain> User-Agent: StGit/unknown-version Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] [PATCH v2 09/24] rte_ring.h: remove signed type flipflopping X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 May 2018 01:59:43 -0000 /projects/lagopus/src/dpdk/build/include/rte_ring.h:350:46: warning: conversion to 'uint32_t' {aka 'unsigned int'} from 'int' may change the sign of the result [-Wsign-conversion] update_tail(&r->prod, prod_head, prod_next, is_sp, 1); The visible apis take unsigned int, then call a private api taking an int, which finally calls an api taking an unsigned int. Convert the private api to take unsigned int removing 5 x warning similar to that shown above. Signed-off-by: Andy Green --- lib/librte_ring/rte_ring.h | 4 ++-- lib/librte_ring/rte_ring_c11_mem.h | 2 +- lib/librte_ring/rte_ring_generic.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h index d3d3f7f97..124582251 100644 --- a/lib/librte_ring/rte_ring.h +++ b/lib/librte_ring/rte_ring.h @@ -335,7 +335,7 @@ void rte_ring_dump(FILE *f, const struct rte_ring *r); static __rte_always_inline unsigned int __rte_ring_do_enqueue(struct rte_ring *r, void * const *obj_table, unsigned int n, enum rte_ring_queue_behavior behavior, - int is_sp, unsigned int *free_space) + unsigned int is_sp, unsigned int *free_space) { uint32_t prod_head, prod_next; uint32_t free_entries; @@ -377,7 +377,7 @@ __rte_ring_do_enqueue(struct rte_ring *r, void * const *obj_table, static __rte_always_inline unsigned int __rte_ring_do_dequeue(struct rte_ring *r, void **obj_table, unsigned int n, enum rte_ring_queue_behavior behavior, - int is_sc, unsigned int *available) + unsigned int is_sc, unsigned int *available) { uint32_t cons_head, cons_next; uint32_t entries; diff --git a/lib/librte_ring/rte_ring_c11_mem.h b/lib/librte_ring/rte_ring_c11_mem.h index 08825ea5b..cb3f82b1a 100644 --- a/lib/librte_ring/rte_ring_c11_mem.h +++ b/lib/librte_ring/rte_ring_c11_mem.h @@ -51,7 +51,7 @@ update_tail(struct rte_ring_headtail *ht, uint32_t old_val, uint32_t new_val, * If behavior == RTE_RING_QUEUE_FIXED, this will be 0 or n only. */ static __rte_always_inline unsigned int -__rte_ring_move_prod_head(struct rte_ring *r, int is_sp, +__rte_ring_move_prod_head(struct rte_ring *r, unsigned int is_sp, unsigned int n, enum rte_ring_queue_behavior behavior, uint32_t *old_head, uint32_t *new_head, uint32_t *free_entries) diff --git a/lib/librte_ring/rte_ring_generic.h b/lib/librte_ring/rte_ring_generic.h index c2d482bc9..ea7dbe5b9 100644 --- a/lib/librte_ring/rte_ring_generic.h +++ b/lib/librte_ring/rte_ring_generic.h @@ -53,7 +53,7 @@ update_tail(struct rte_ring_headtail *ht, uint32_t old_val, uint32_t new_val, * If behavior == RTE_RING_QUEUE_FIXED, this will be 0 or n only. */ static __rte_always_inline unsigned int -__rte_ring_move_prod_head(struct rte_ring *r, int is_sp, +__rte_ring_move_prod_head(struct rte_ring *r, unsigned int is_sp, unsigned int n, enum rte_ring_queue_behavior behavior, uint32_t *old_head, uint32_t *new_head, uint32_t *free_entries) @@ -123,7 +123,7 @@ __rte_ring_move_prod_head(struct rte_ring *r, int is_sp, * If behavior == RTE_RING_QUEUE_FIXED, this will be 0 or n only. */ static __rte_always_inline unsigned int -__rte_ring_move_cons_head(struct rte_ring *r, int is_sc, +__rte_ring_move_cons_head(struct rte_ring *r, unsigned int is_sc, unsigned int n, enum rte_ring_queue_behavior behavior, uint32_t *old_head, uint32_t *new_head, uint32_t *entries)