[2/2] drivers: don't use rte_strlcpy

Message ID 20230531220533.29910-3-stephen@networkplumber.org (mailing list archive)
State Rejected, archived
Delegated to: Thomas Monjalon
Headers
Series cleanup use of rte_strlcpy |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS

Commit Message

Stephen Hemminger May 31, 2023, 10:05 p.m. UTC
  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(-)
  

Patch

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));