From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C07D542BF9; Thu, 1 Jun 2023 00:06:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 46BCC42C4D; Thu, 1 Jun 2023 00:05:48 +0200 (CEST) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id 18277427E9 for ; Thu, 1 Jun 2023 00:05:47 +0200 (CEST) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1b01dac1a82so778175ad.2 for ; Wed, 31 May 2023 15:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1685570746; x=1688162746; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7tFfYxa2Sy8xyl2AQjNrEM3k92hlHYw9ZunDMB7o3qs=; b=jJI6/EGfowQFUYj84qNRJtZzcQtXH18hzV1hE3GGY84bm2OBx1eLOcheitptSwvLuo /RZf77fo0sTyf/WJhyEeMqS2aLJddhO1aVpVMA6C60XP8waOMmEciSJ1lDsVDpM3Szjj Ah3TlW1CSxxe519Q5pQIF79ICKgowzmbz1i1PCfA9qE4/XHso8eKZmfqT56XE0ty8WLs zbMyEP1qudQ0yxaZTxMw8jD6sMSSfzuQ3HLUFsdmU3hXElb8dRt9FSC4wlgXM0Ms8o5C Y8KkXZsbrxcJKESj24ywKg3/kkVKf9VrBMYVGnkNW+0pHiSLoQQwZdGKmxW459g61Ky0 /xYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685570746; x=1688162746; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7tFfYxa2Sy8xyl2AQjNrEM3k92hlHYw9ZunDMB7o3qs=; b=SY5ro/RTWDTf10+2b1t1UW5esBj6BoKumnSkRa6/NHAkrsSSd5MDd8IfKaAyD9ottW jcMjK59wBtYjjdoJDqnyxFoE+A3/Xxno7EPCqqijbCaDvqbWBwWu9mjznPL3LvBTQGrM OqNaIcZKvqPffxStO2YO1wUmvBtvyZfPWrOzOYysaMOlAF9wO/ql4mIxvat9gEZWU/5r X3xuDK2lF0ijMY4YPoXjSREQt12+wmOpA6ZLrrA1Z7h9brZLcMcd4ZMEQ/PQEjB3igHq DySXbqIx7gZjnT9bYNvBvNmlPZEoztORpdhQsGvkBy1+Uacd8jtuUzvVvYuICLmwkoRF XMFA== X-Gm-Message-State: AC+VfDx70D4HJaOMPe9B6fVBO8jXNZbnq3SgF+rBJwWiK12GogU4pFVh IVsSsm9l46kuUkGAabiORgPJMIm+7HogTjkNvG2XaA== X-Google-Smtp-Source: ACHHUZ5yXDkvG/MoAkMYj093Qg5t7TwWbI0IZ8O7GKQwYUZpGKRDQ0d7YzwIOfv0KJQkQU0RXIVAUQ== X-Received: by 2002:a17:902:db02:b0:1b1:99c9:8ce1 with SMTP id m2-20020a170902db0200b001b199c98ce1mr323260plx.51.1685570746061; Wed, 31 May 2023 15:05:46 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id g23-20020a1709029f9700b001b077301b15sm1888623plq.156.2023.05.31.15.05.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 15:05:45 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH 2/2] drivers: don't use rte_strlcpy Date: Wed, 31 May 2023 15:05:33 -0700 Message-Id: <20230531220533.29910-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230531220533.29910-1-stephen@networkplumber.org> References: <20230531220533.29910-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Prefer using strlcpy over rte_strlcpy. Signed-off-by: Stephen Hemminger --- 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