From: Ferruh Yigit <ferruh.yigit@intel.com>
To: dev@dpdk.org, Tetsuya Mukawa <mtetsuyah@gmail.com>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>
Subject: [dpdk-dev] [PATCH 4/6] net/null: prefer unsigned int
Date: Mon, 2 Mar 2020 17:36:43 +0000 [thread overview]
Message-ID: <20200302173646.54984-4-ferruh.yigit@intel.com> (raw)
In-Reply-To: <20200302173646.54984-1-ferruh.yigit@intel.com>
Prefer 'unsigned int' storage type keyword against 'unsigned', this also
silence the checkpatch warnings.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
drivers/net/null/rte_eth_null.c | 46 ++++++++++++++++-----------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index beedd5f4b..7fa3b9e45 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -15,8 +15,8 @@
#define ETH_NULL_PACKET_SIZE_ARG "size"
#define ETH_NULL_PACKET_COPY_ARG "copy"
-static unsigned default_packet_size = 64;
-static unsigned default_packet_copy;
+static unsigned int default_packet_size = 64;
+static unsigned int default_packet_copy;
static const char *valid_arguments[] = {
ETH_NULL_PACKET_SIZE_ARG,
@@ -37,8 +37,8 @@ struct null_queue {
};
struct pmd_internals {
- unsigned packet_size;
- unsigned packet_copy;
+ unsigned int packet_size;
+ unsigned int packet_copy;
uint16_t port_id;
struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT];
@@ -74,7 +74,7 @@ eth_null_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
{
int i;
struct null_queue *h = q;
- unsigned packet_size;
+ unsigned int packet_size;
if ((q == NULL) || (bufs == NULL))
return 0;
@@ -99,7 +99,7 @@ eth_null_copy_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
{
int i;
struct null_queue *h = q;
- unsigned packet_size;
+ unsigned int packet_size;
if ((q == NULL) || (bufs == NULL))
return 0;
@@ -143,7 +143,7 @@ eth_null_copy_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
{
int i;
struct null_queue *h = q;
- unsigned packet_size;
+ unsigned int packet_size;
if ((q == NULL) || (bufs == NULL))
return 0;
@@ -194,7 +194,7 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
{
struct rte_mbuf *dummy_packet;
struct pmd_internals *internals;
- unsigned packet_size;
+ unsigned int packet_size;
if ((dev == NULL) || (mb_pool == NULL))
return -EINVAL;
@@ -228,7 +228,7 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
{
struct rte_mbuf *dummy_packet;
struct pmd_internals *internals;
- unsigned packet_size;
+ unsigned int packet_size;
if (dev == NULL)
return -EINVAL;
@@ -283,7 +283,7 @@ eth_dev_info(struct rte_eth_dev *dev,
static int
eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *igb_stats)
{
- unsigned i, num_stats;
+ unsigned int i, num_stats;
unsigned long rx_total = 0, tx_total = 0;
const struct pmd_internals *internal;
@@ -291,7 +291,7 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *igb_stats)
return -EINVAL;
internal = dev->data->dev_private;
- num_stats = RTE_MIN((unsigned)RTE_ETHDEV_QUEUE_STAT_CNTRS,
+ num_stats = RTE_MIN((unsigned int)RTE_ETHDEV_QUEUE_STAT_CNTRS,
RTE_MIN(dev->data->nb_rx_queues,
RTE_DIM(internal->rx_null_queues)));
for (i = 0; i < num_stats; i++) {
@@ -300,7 +300,7 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *igb_stats)
rx_total += igb_stats->q_ipackets[i];
}
- num_stats = RTE_MIN((unsigned)RTE_ETHDEV_QUEUE_STAT_CNTRS,
+ num_stats = RTE_MIN((unsigned int)RTE_ETHDEV_QUEUE_STAT_CNTRS,
RTE_MIN(dev->data->nb_tx_queues,
RTE_DIM(internal->tx_null_queues)));
for (i = 0; i < num_stats; i++) {
@@ -318,7 +318,7 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *igb_stats)
static int
eth_stats_reset(struct rte_eth_dev *dev)
{
- unsigned i;
+ unsigned int i;
struct pmd_internals *internal;
if (dev == NULL)
@@ -463,11 +463,11 @@ static const struct eth_dev_ops ops = {
static int
eth_dev_null_create(struct rte_vdev_device *dev,
- unsigned packet_size,
- unsigned packet_copy)
+ unsigned int packet_size,
+ unsigned int packet_copy)
{
- const unsigned nb_rx_queues = 1;
- const unsigned nb_tx_queues = 1;
+ const unsigned int nb_rx_queues = 1;
+ const unsigned int nb_tx_queues = 1;
struct rte_eth_dev_data *data;
struct pmd_internals *internals = NULL;
struct rte_eth_dev *eth_dev = NULL;
@@ -537,12 +537,12 @@ get_packet_size_arg(const char *key __rte_unused,
const char *value, void *extra_args)
{
const char *a = value;
- unsigned *packet_size = extra_args;
+ unsigned int *packet_size = extra_args;
if ((value == NULL) || (extra_args == NULL))
return -EINVAL;
- *packet_size = (unsigned)strtoul(a, NULL, 0);
+ *packet_size = (unsigned int)strtoul(a, NULL, 0);
if (*packet_size == UINT_MAX)
return -1;
@@ -554,12 +554,12 @@ get_packet_copy_arg(const char *key __rte_unused,
const char *value, void *extra_args)
{
const char *a = value;
- unsigned *packet_copy = extra_args;
+ unsigned int *packet_copy = extra_args;
if ((value == NULL) || (extra_args == NULL))
return -EINVAL;
- *packet_copy = (unsigned)strtoul(a, NULL, 0);
+ *packet_copy = (unsigned int)strtoul(a, NULL, 0);
if (*packet_copy == UINT_MAX)
return -1;
@@ -570,8 +570,8 @@ static int
rte_pmd_null_probe(struct rte_vdev_device *dev)
{
const char *name, *params;
- unsigned packet_size = default_packet_size;
- unsigned packet_copy = default_packet_copy;
+ unsigned int packet_size = default_packet_size;
+ unsigned int packet_copy = default_packet_copy;
struct rte_kvargs *kvlist = NULL;
struct rte_eth_dev *eth_dev;
int ret;
--
2.24.1
next prev parent reply other threads:[~2020-03-02 17:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-02 17:36 [dpdk-dev] [PATCH 1/6] net/null: fix secondary burst function selection Ferruh Yigit
2020-03-02 17:36 ` [dpdk-dev] [PATCH 2/6] doc: add net null PMD guide Ferruh Yigit
2020-03-02 17:36 ` [dpdk-dev] [PATCH 3/6] net/null: remove redundant check Ferruh Yigit
2020-03-02 17:36 ` Ferruh Yigit [this message]
2020-03-02 17:36 ` [dpdk-dev] [PATCH 5/6] net/null: group device arguments Ferruh Yigit
2020-03-02 17:36 ` [dpdk-dev] [PATCH 6/6] net/null: add argument for no Rx Ferruh Yigit
2020-04-07 8:38 ` [dpdk-dev] [PATCH 1/6] net/null: fix secondary burst function selection Ferruh Yigit
2020-04-10 8:33 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
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=20200302173646.54984-4-ferruh.yigit@intel.com \
--to=ferruh.yigit@intel.com \
--cc=dev@dpdk.org \
--cc=mtetsuyah@gmail.com \
/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).