DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH 2/2] drivers: don't use rte_strlcpy
Date: Wed, 31 May 2023 15:05:33 -0700	[thread overview]
Message-ID: <20230531220533.29910-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20230531220533.29910-1-stephen@networkplumber.org>

Prefer using strlcpy over rte_strlcpy.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/common/cnxk/roc_platform.h            | 2 +-
 drivers/mempool/cnxk/cnxk_mempool_telemetry.c | 2 +-
 drivers/net/cnxk/cnxk_ethdev_ops.c            | 4 ++--
 drivers/net/mlx5/mlx5_testpmd.c               | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h
index 9884398a99d3..921447d735b7 100644
--- a/drivers/common/cnxk/roc_platform.h
+++ b/drivers/common/cnxk/roc_platform.h
@@ -215,7 +215,7 @@
 
 #define plt_lcore_id rte_lcore_id
 
-#define plt_strlcpy rte_strlcpy
+#define plt_strlcpy strlcpy
 
 #define PLT_TEL_INT_VAL              RTE_TEL_INT_VAL
 #define PLT_TEL_STRING_VAL           RTE_TEL_STRING_VAL
diff --git a/drivers/mempool/cnxk/cnxk_mempool_telemetry.c b/drivers/mempool/cnxk/cnxk_mempool_telemetry.c
index c71798d7fd66..d766bd079d81 100644
--- a/drivers/mempool/cnxk/cnxk_mempool_telemetry.c
+++ b/drivers/mempool/cnxk/cnxk_mempool_telemetry.c
@@ -39,7 +39,7 @@ mempool_tel_handle_info(const char *cmd __rte_unused, const char *params,
 	if (params == NULL || strlen(params) == 0)
 		return -EINVAL;
 
-	rte_strlcpy(name, params, RTE_MEMZONE_NAMESIZE);
+	strlcpy(name, params, RTE_MEMZONE_NAMESIZE);
 
 	rte_tel_data_start_dict(d);
 	mp_arg.pool_name = name;
diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c
index 068b7c3502c5..9ffc02b591ae 100644
--- a/drivers/net/cnxk/cnxk_ethdev_ops.c
+++ b/drivers/net/cnxk/cnxk_ethdev_ops.c
@@ -753,12 +753,12 @@ cnxk_nix_fw_version_get(struct rte_eth_dev *eth_dev, char *fw_version,
 {
 	struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
 	const char *str = roc_npc_profile_name_get(&dev->npc);
-	uint32_t size = strlen(str) + 1;
+	size_t size = strlen(str) + 1;
 
 	if (fw_size > size)
 		fw_size = size;
 
-	rte_strlcpy(fw_version, str, fw_size);
+	strlcpy(fw_version, str, fw_size);
 
 	if (fw_size < size)
 		return size;
diff --git a/drivers/net/mlx5/mlx5_testpmd.c b/drivers/net/mlx5/mlx5_testpmd.c
index 879ea2826ef2..45533fd0e11a 100644
--- a/drivers/net/mlx5/mlx5_testpmd.c
+++ b/drivers/net/mlx5/mlx5_testpmd.c
@@ -179,7 +179,7 @@ mlx5_test_extend_devargs(char *identifier, char *extend)
 			    strerror(errno));
 		return -1;
 	}
-	rte_strlcpy(un.sun_path, path, sizeof(un.sun_path));
+	strlcpy(un.sun_path, path, sizeof(un.sun_path));
 	if (connect(socket_fd, (struct sockaddr *)&un, sizeof(un)) < 0) {
 		TESTPMD_LOG(ERR, "Failed to connect %s: %s\n", un.sun_path,
 			    strerror(errno));
-- 
2.39.2


  parent reply	other threads:[~2023-05-31 22:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 22:05 [PATCH 0/2] cleanup use of rte_strlcpy Stephen Hemminger
2023-05-31 22:05 ` [PATCH 1/2] lib: replace rte_strlcpy() with strlcpy() Stephen Hemminger
2023-05-31 22:05 ` Stephen Hemminger [this message]
2023-06-01 10:18 ` [PATCH 0/2] cleanup use of rte_strlcpy Bruce Richardson
2023-06-02 21:46   ` Tyler Retzlaff

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=20230531220533.29910-3-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --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).