DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andy Green <andy@warmcat.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v4 07/23] rte_ring.h: remove signed type flipflopping
Date: Mon, 14 May 2018 13:10:02 +0800	[thread overview]
Message-ID: <152627460274.53156.14436567362656342224.stgit@localhost.localdomain> (raw)
In-Reply-To: <152627436523.53156.4398253089110011263.stgit@localhost.localdomain>

/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 <andy@warmcat.com>
---
 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)

  parent reply	other threads:[~2018-05-14  5:10 UTC|newest]

Thread overview: 174+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-12  1:58 [dpdk-dev] [PATCH v3 00/24] Fixes for GCC8 against lagopus Andy Green
2018-05-12  1:58 ` [dpdk-dev] [PATCH v3 01/24] lib/librte_eal: import libbsd strlcpy Andy Green
2018-05-13 14:56   ` Thomas Monjalon
2018-05-13 23:07     ` Andy Green
2018-05-12  1:58 ` [dpdk-dev] [PATCH v3 02/24] lib/librte_ethdev: change eth-dev-ops API to return int Andy Green
2018-05-13 14:58   ` Thomas Monjalon
2018-05-13 23:10     ` Andy Green
2018-05-13 23:49       ` Thomas Monjalon
2018-05-12  1:58 ` [dpdk-dev] [PATCH v3 03/24] rte_common.h: cast gcc builtin result to avoid complaints Andy Green
2018-05-13 20:40   ` Thomas Monjalon
2018-05-12  1:59 ` [dpdk-dev] [PATCH v3 04/24] lib/librte_eal: explicit tmp cast Andy Green
2018-05-13 16:19   ` Thomas Monjalon
2018-05-12  1:59 ` [dpdk-dev] [PATCH v3 05/24] lib/librte_eal: explicit cast for signed change Andy Green
2018-05-13 20:40   ` Thomas Monjalon
2018-05-12  1:59 ` [dpdk-dev] [PATCH v3 06/24] /lib/librte_eal: stage cast from uint64 to long Andy Green
2018-05-13 16:24   ` Thomas Monjalon
2018-05-13 23:17     ` Andy Green
2018-05-12  1:59 ` [dpdk-dev] [PATCH v3 07/24] rte_spinlock.h: stack declarations before code Andy Green
2018-05-13 20:42   ` Thomas Monjalon
2018-05-12  1:59 ` [dpdk-dev] [PATCH v3 08/24] rte_ring_generic.h: " Andy Green
2018-05-13 16:47   ` Thomas Monjalon
2018-05-13 23:21     ` Andy Green
2018-05-13 23:44       ` Thomas Monjalon
2018-05-14  0:09         ` Andy Green
2018-05-14  1:49           ` Thomas Monjalon
2018-05-12  1:59 ` [dpdk-dev] [PATCH v3 09/24] rte_ring.h: remove signed type flipflopping Andy Green
2018-05-12  1:59 ` [dpdk-dev] [PATCH v3 10/24] rte_dev.h: stack declaration at top of own basic block Andy Green
2018-05-13 20:41   ` Thomas Monjalon
2018-05-12  1:59 ` [dpdk-dev] [PATCH v3 11/24] rte_mbuf.h: avoid warnings from inadvertant promotion Andy Green
2018-05-13 16:54   ` Thomas Monjalon
2018-05-13 23:27     ` Andy Green
2018-05-12  1:59 ` [dpdk-dev] [PATCH v3 12/24] rte_mbuf.h: explicit casts for int16 to uint16 Andy Green
2018-05-12  1:59 ` [dpdk-dev] [PATCH v3 13/24] rte_mbuf.h: make sure RTE-MIN compares same types Andy Green
2018-05-12  1:59 ` [dpdk-dev] [PATCH v3 14/24] rte_mbuf.h: explicit cast restricting ptrdiff to uint16 Andy Green
2018-05-12  1:59 ` [dpdk-dev] [PATCH v3 15/24] rte_mbuf.h: explicit cast for size type to uint32 Andy Green
2018-05-12  2:00 ` [dpdk-dev] [PATCH v3 16/24] rte_mbuf.h: explicit casts to uint16 to avoid warnings Andy Green
2018-05-12  2:00 ` [dpdk-dev] [PATCH v3 17/24] rte_byteorder.h: explicit cast for return promotion Andy Green
2018-05-13 16:59   ` Thomas Monjalon
2018-05-14  0:02     ` Andy Green
2018-05-12  2:00 ` [dpdk-dev] [PATCH v3 18/24] rte_ether.h: explicit cast avoiding truncation warning Andy Green
2018-05-13 17:02   ` Thomas Monjalon
2018-05-14  0:05     ` Andy Green
2018-05-12  2:00 ` [dpdk-dev] [PATCH v3 19/24] rte_ether.h: stack vars declared at top of function Andy Green
2018-05-13 20:42   ` Thomas Monjalon
2018-05-12  2:00 ` [dpdk-dev] [PATCH v3 20/24] rte_ethdev.h: align sign and scope of temp var Andy Green
2018-05-12  2:00 ` [dpdk-dev] [PATCH v3 21/24] rte_ethdev.h: explicit cast for truncation Andy Green
2018-05-13 20:43   ` Thomas Monjalon
2018-05-12  2:00 ` [dpdk-dev] [PATCH v3 22/24] rte_hash_crc.h: stack vars declared at top of function Andy Green
2018-05-13 20:44   ` Thomas Monjalon
2018-05-12  2:00 ` [dpdk-dev] [PATCH v3 23/24] rte_hash_crc.h: explicit casts for truncation Andy Green
2018-05-13 20:44   ` Thomas Monjalon
2018-05-12  2:00 ` [dpdk-dev] [PATCH v3 24/24] test_table_pipeline: repair munged indirection level Andy Green
2018-05-13 20:33   ` Thomas Monjalon
2018-05-14  0:22     ` Andy Green
2018-05-14  5:09 ` [dpdk-dev] [PATCH v4 00/23] Fixes for GCC8 against lagopus Andy Green
2018-05-14  5:09   ` [dpdk-dev] [PATCH v4 01/23] lib/librte_eal: import libbsd strlcpy Andy Green
2018-05-17 10:36     ` Bruce Richardson
2018-05-17 12:35       ` Andy Green
2018-05-17 12:56         ` Bruce Richardson
2018-05-17 13:00           ` Andy Green
2018-05-17 13:49             ` Bruce Richardson
2018-05-14  5:09   ` [dpdk-dev] [PATCH v4 02/23] rte_eal_version_map: export rte-strlcpy Andy Green
2018-05-14  5:09   ` [dpdk-dev] [PATCH v4 03/23] lib/librte_ethdev: change eth-dev-ops API to return int Andy Green
2018-05-14  5:09   ` [dpdk-dev] [PATCH v4 04/23] lib/librte_eal: explicit tmp cast Andy Green
2018-05-14  5:09   ` [dpdk-dev] [PATCH v4 05/23] /lib/librte_eal: stage cast from uint64 to long Andy Green
2018-05-17 10:47     ` Bruce Richardson
2018-05-17 12:56       ` Andy Green
2018-05-14  5:09   ` [dpdk-dev] [PATCH v4 06/23] rte_ring_generic.h: stack declarations before code Andy Green
2018-05-17  8:29     ` Olivier Matz
2018-05-14  5:10   ` Andy Green [this message]
2018-05-17  8:29     ` [dpdk-dev] [PATCH v4 07/23] rte_ring.h: remove signed type flipflopping Olivier Matz
2018-05-14  5:10   ` [dpdk-dev] [PATCH v4 08/23] rte_mbuf.h: avoid warnings from inadvertant promotion Andy Green
2018-05-17  8:30     ` Olivier Matz
2018-05-14  5:10   ` [dpdk-dev] [PATCH v4 09/23] rte_mbuf.h: explicit casts for int16 to uint16 Andy Green
2018-05-17  8:30     ` Olivier Matz
2018-05-14  5:10   ` [dpdk-dev] [PATCH v4 10/23] rte_mbuf.h: make sure RTE-MIN compares same types Andy Green
2018-05-17 10:49     ` Bruce Richardson
2018-05-14  5:10   ` [dpdk-dev] [PATCH v4 11/23] rte_mbuf.h: explicit cast restricting ptrdiff to uint16 Andy Green
2018-05-17 10:50     ` Bruce Richardson
2018-05-17 11:03       ` Ananyev, Konstantin
2018-05-14  5:10   ` [dpdk-dev] [PATCH v4 12/23] rte_mbuf.h: explicit cast for size type to uint32 Andy Green
2018-05-17 10:53     ` Bruce Richardson
2018-05-17 13:09       ` Andy Green
2018-05-14  5:10   ` [dpdk-dev] [PATCH v4 13/23] rte_mbuf.h: explicit casts to uint16 to avoid warnings Andy Green
2018-05-17 10:58     ` Bruce Richardson
2018-05-17 13:28       ` Andy Green
2018-05-14  5:10   ` [dpdk-dev] [PATCH v4 14/23] rte_ether.h: explicit cast avoiding truncation warning Andy Green
2018-05-17 11:01     ` Bruce Richardson
2018-05-14  5:10   ` [dpdk-dev] [PATCH v4 15/23] rte_ethdev.h: align sign and scope of temp var Andy Green
2018-05-17 13:54     ` Bruce Richardson
2018-05-17 14:17       ` Andy Green
2018-05-17 14:26         ` Bruce Richardson
2018-05-14  5:10   ` [dpdk-dev] [PATCH v4 16/23] rte_byteorder.h: explicit cast for return promotion Andy Green
2018-05-14  5:10   ` [dpdk-dev] [PATCH v4 17/23] test_table_pipeline: repair munged indirection level Andy Green
2018-05-14 10:35     ` Singh, Jasvinder
2018-05-14 10:46       ` Andy Green
2018-05-14  5:10   ` [dpdk-dev] [PATCH v4 18/23] rte_rwlock.h: gcc8 sign conversion warnings Andy Green
2018-05-14  5:11   ` [dpdk-dev] [PATCH v4 19/23] rte_ip.h: cast input to bswap16 to be uint16 Andy Green
2018-05-14  5:11   ` [dpdk-dev] [PATCH v4 20/23] rte_ip.h: cast around promotion to int Andy Green
2018-05-14  5:11   ` [dpdk-dev] [PATCH v4 21/23] rte_ip.h: cast type decided by sizeof to uint32 Andy Green
2018-05-14  5:11   ` [dpdk-dev] [PATCH v4 22/23] rte_ip.h: cast return checksum size to uint16 Andy Green
2018-05-14  5:11   ` [dpdk-dev] [PATCH v4 23/23] rte_ip.h: cast away gcc8 warning on rte_ipv6_phdr_cksum Andy Green
2018-05-17 13:48   ` [dpdk-dev] [PATCH v5 00/21] Fixes for GCC8 against lagopus Andy Green
2018-05-17 13:48     ` [dpdk-dev] [PATCH v5 01/21] lib/librte_ethdev: change eth-dev-ops API to return int Andy Green
2018-05-17 13:55       ` Bruce Richardson
2018-05-17 13:59         ` Andy Green
2018-05-18 10:59       ` Shreyansh Jain
2018-05-18 11:12         ` Andy Green
2018-05-20  2:43           ` Shreyansh Jain
2018-05-20  4:11             ` Andy Green
2018-05-21  6:52             ` Stephen Hemminger
2018-05-21  7:25               ` Andy Green
2018-05-18 13:02         ` [dpdk-dev] [PATCH] rte_ethdev.h: fix gcc8.1 sign conversion warining Andy Green
2018-05-17 13:49     ` [dpdk-dev] [PATCH v5 02/21] rte_string_fns.h: fix gcc8.1 sign conv warning in lstrcpy Andy Green
2018-05-17 13:56       ` Bruce Richardson
2018-05-17 14:03       ` [dpdk-dev] [PATCH] " Andy Green
2018-05-17 14:40       ` [dpdk-dev] [PATCH v5 02/21] " Stephen Hemminger
2018-05-17 15:28         ` Bruce Richardson
2018-05-17 13:49     ` [dpdk-dev] [PATCH v5 03/21] lib/librte_eal: explicit tmp cast Andy Green
2018-05-17 13:49     ` [dpdk-dev] [PATCH v5 04/21] /lib/librte_eal: stage cast from uint64 to long Andy Green
2018-05-17 13:49     ` [dpdk-dev] [PATCH v5 05/21] rte_ring_generic.h: stack declarations before code Andy Green
2018-05-17 13:49     ` [dpdk-dev] [PATCH v5 06/21] rte_ring.h: remove signed type flipflopping Andy Green
2018-05-17 13:49     ` [dpdk-dev] [PATCH v5 07/21] rte_mbuf.h: avoid warnings from inadvertant promotion Andy Green
2018-05-17 13:49     ` [dpdk-dev] [PATCH v5 08/21] rte_mbuf.h: explicit casts for int16 to uint16 Andy Green
2018-05-17 13:49     ` [dpdk-dev] [PATCH v5 09/21] rte_mbuf.h: make sure RTE-MIN compares same types Andy Green
2018-05-17 13:49     ` [dpdk-dev] [PATCH v5 10/21] rte_mbuf.h: explicit cast restricting ptrdiff to uint16 Andy Green
2018-05-17 13:49     ` [dpdk-dev] [PATCH v5 11/21] rte_ether.h: explicit cast avoiding truncation warning Andy Green
2018-05-17 13:49     ` [dpdk-dev] [PATCH v5 12/21] rte_rwlock.h: gcc8 sign conversion warnings Andy Green
2018-05-17 13:49     ` [dpdk-dev] [PATCH v5 13/21] rte_ip.h: cast input to bswap16 to be uint16 Andy Green
2018-05-17 13:50     ` [dpdk-dev] [PATCH v5 14/21] rte_ip.h: cast around promotion to int Andy Green
2018-05-17 13:50     ` [dpdk-dev] [PATCH v5 15/21] rte_ip.h: cast type decided by sizeof to uint32 Andy Green
2018-05-17 13:50     ` [dpdk-dev] [PATCH v5 16/21] rte_ip.h: cast return checksum size to uint16 Andy Green
2018-05-17 13:50     ` [dpdk-dev] [PATCH v5 17/21] rte_ip.h: cast away gcc8 warning on rte_ipv6_phdr_cksum Andy Green
2018-05-17 13:50     ` [dpdk-dev] [PATCH v5 18/21] rte_mbuf.h: explicit cast for size type to uint32 Andy Green
2018-05-17 13:50     ` [dpdk-dev] [PATCH v5 19/21] rte_mbuf.h: explicit casts to uint16 to avoid warnings Andy Green
2018-05-17 13:50     ` [dpdk-dev] [PATCH v5 20/21] rte_ethdev.h: align sign and scope of temp var Andy Green
2018-05-17 13:50     ` [dpdk-dev] [PATCH v5 21/21] rte_byteorder.h: explicit cast for return promotion Andy Green
2018-05-20 22:18     ` [dpdk-dev] [PATCH v5 00/21] Fixes for GCC8 against lagopus Thomas Monjalon
2018-05-21  2:00       ` [dpdk-dev] [PATCH v6 0/8] " Andy Green
2018-05-21  2:00         ` [dpdk-dev] [PATCH v6 1/8] lib/librte_eal: explicit tmp cast Andy Green
2018-05-21 11:06           ` [dpdk-dev] [PATCH] lib/librte_eal: change type of tmp Andy Green
2018-05-21 12:07             ` Bruce Richardson
2018-05-21  2:01         ` [dpdk-dev] [PATCH v6 2/8] rte_rwlock.h: gcc8 sign conversion warnings Andy Green
2018-05-21 12:10           ` Bruce Richardson
2018-05-21  2:01         ` [dpdk-dev] [PATCH v6 3/8] rte_ip.h: cast type decided by sizeof to uint32 Andy Green
2018-05-21 12:13           ` Bruce Richardson
2018-05-21  2:01         ` [dpdk-dev] [PATCH v6 4/8] rte_mbuf.h: reduce temp to match uint16 types Andy Green
2018-05-21 12:14           ` Bruce Richardson
2018-05-21  2:01         ` [dpdk-dev] [PATCH v6 5/8] rte_mbuf.h: avoid implicit demotion in 64-bit arith Andy Green
2018-05-21 12:27           ` Bruce Richardson
2018-05-22  1:29             ` Andy Green
2018-05-21  2:01         ` [dpdk-dev] [PATCH v6 6/8] rte_mbuf.h: choose correct type for temp Andy Green
2018-05-21 13:09           ` Bruce Richardson
2018-05-21  2:01         ` [dpdk-dev] [PATCH v6 7/8] rte_mbuf.h: add and subtract explicitly to avoid promotion Andy Green
2018-05-21 13:10           ` Bruce Richardson
2018-05-21  2:01         ` [dpdk-dev] [PATCH v6 8/8] rte_ethdev.h: align sign and scope of temp var Andy Green
2018-05-21 13:30           ` Bruce Richardson
2018-05-22  1:25             ` Andy Green
2018-05-22  1:24         ` [dpdk-dev] [PATCH v7 0/8] Fixes for GCC8 against lagopus Andy Green
2018-05-22  1:24           ` [dpdk-dev] [PATCH v7 1/8] lib/librte_eal: change type of tmp Andy Green
2018-05-22  9:13             ` Bruce Richardson
2018-05-22  1:24           ` [dpdk-dev] [PATCH v7 2/8] rte_rwlock.h: gcc8 sign conversion warnings Andy Green
2018-05-22  1:24           ` [dpdk-dev] [PATCH v7 3/8] rte_ip.h: cast type decided by sizeof to uint32 Andy Green
2018-05-22  1:24           ` [dpdk-dev] [PATCH v7 4/8] rte_mbuf.h: reduce temp to match uint16 types Andy Green
2018-05-22  1:24           ` [dpdk-dev] [PATCH v7 5/8] rte_mbuf.h: avoid implicit demotion in 64-bit arith Andy Green
2018-05-22  1:24           ` [dpdk-dev] [PATCH v7 6/8] rte_mbuf.h: choose correct type for temp Andy Green
2018-05-22  1:24           ` [dpdk-dev] [PATCH v7 7/8] rte_mbuf.h: add and subtract explicitly to avoid promotion Andy Green
2018-05-22  1:24           ` [dpdk-dev] [PATCH v7 8/8] rte_ethdev.h: align sign and scope of temp var Andy Green
2018-05-22  9:12             ` Bruce Richardson
2018-05-22 14:18             ` Thomas Monjalon
2018-05-22  9:13           ` [dpdk-dev] [PATCH v7 0/8] Fixes for GCC8 against lagopus Bruce Richardson
2018-05-22  9:14             ` Andy Green
2018-05-22 14:29             ` Thomas Monjalon
2018-05-21  2:06       ` [dpdk-dev] [PATCH v5 00/21] " Andy Green

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=152627460274.53156.14436567362656342224.stgit@localhost.localdomain \
    --to=andy@warmcat.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).