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 11D2242C04; Thu, 1 Jun 2023 17:04:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8DB7C42DB9; Thu, 1 Jun 2023 17:01:34 +0200 (CEST) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id 56AA242D93 for ; Thu, 1 Jun 2023 17:01:31 +0200 (CEST) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1b024e29657so4264485ad.3 for ; Thu, 01 Jun 2023 08:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1685631690; x=1688223690; 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=70HxSvyY6cwn3irxYhJzEh4895TjypQ8oU2O13BnGGo=; b=Y9M5rqyZGLeMy2rHZGJa7Yq1znf++MhYwwflGcs9fRR2yOPW/aEdH0pZ0klOlGGhM8 newnh7VRZqgnV4HS+0OFrS+mG+lfnulN/X52mKFo3cImVtK42XErLLG8sRkAdXjnJq5A 6w+uoOs4QOe9KCxv7C2pmVk5AJDXh9WODD4J+jS3+UPP7WkyKTguk9VWlu+2GUMLoult 4cZWRqjC8ISrIaC/7jwofeYh2iVUfjwYfnkJMILu5Vxz6Pp9eaxvZsYjJ5vVRavIIErK 3bwI92irgwR69Z381DrbLQlbmLZzoD5ci4hLTcQqIeYHHH7yex9GbAwnHOSfFRGjzSnz 8CQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685631690; x=1688223690; 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=70HxSvyY6cwn3irxYhJzEh4895TjypQ8oU2O13BnGGo=; b=HUoH2f48Z+Ztci14dK7J2VvmAiTHwmUBtPLv7rXTtqwyU1FD4NqyOSuEET0e+QawRT FRTuZcc/03sgQMeiXxK0jb8q7/UMOlXEHX8/e8PRp0VFUkoJrycnAZvL7bY+hR1yfLOC zVfBXCEbIhPS3/Oecu3QBmmapqG9d2e97LHhU7o70Qozcj539e7mn+WdYmkwDyqzeIp4 QWU8s525HY9rACUso/GyYvDEEW20+LGP600J48Fow7MAyPWMCbXsaxHADV9UtmzIfw29 J6SUMoH02F53jBjcBJjdq0En2MAuYsO6idvbW53ZUfUegMWsa+0avjj/SUBXGJPXWj/1 CXQQ== X-Gm-Message-State: AC+VfDyYtxsq8sspHRTX7OJXe8lqLLBTjmzCEu31piNSS5AfooVaUTv9 5XpuIUpzvDVI6Xvg52QfO+Ozaqe/5f9F8r6L7aETAw== X-Google-Smtp-Source: ACHHUZ6Af407cHEJWo4Q9vh7UeDUhzfiYWo6/vzL/HKBCs1z9VF9ifOIisHec1Q8q6oVt1o9WHZQvw== X-Received: by 2002:a17:902:a60c:b0:1b1:95ac:a4da with SMTP id u12-20020a170902a60c00b001b195aca4damr1677471plq.8.1685631690657; Thu, 01 Jun 2023 08:01:30 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id ij9-20020a170902ab4900b001ac40488620sm3661955plb.92.2023.06.01.08.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 08:01:30 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Hemant Agrawal , Sachin Saxena Subject: [PATCH 16/25] net/dpaa*: replace snprintf with strlcpy Date: Thu, 1 Jun 2023 08:00:57 -0700 Message-Id: <20230601150106.18375-17-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230601150106.18375-1-stephen@networkplumber.org> References: <20230601150106.18375-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 Suggested by devtools/cocci/strlcpy-with-header.cocci Signed-off-by: Stephen Hemminger --- drivers/net/dpaa/dpaa_ethdev.c | 8 ++++---- drivers/net/dpaa2/dpaa2_ethdev.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index a6c86113d125..0076a531005b 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -620,8 +620,8 @@ dpaa_dev_rx_burst_mode_get(struct rte_eth_dev *dev, /* Update Rx offload info */ for (i = 0; i < RTE_DIM(rx_offload_map); i++) { if (eth_conf->rxmode.offloads & rx_offload_map[i].flags) { - snprintf(mode->info, sizeof(mode->info), "%s", - rx_offload_map[i].output); + strlcpy(mode->info, rx_offload_map[i].output, + sizeof(mode->info)); ret = 0; break; } @@ -654,8 +654,8 @@ dpaa_dev_tx_burst_mode_get(struct rte_eth_dev *dev, /* Update Tx offload info */ for (i = 0; i < RTE_DIM(tx_offload_map); i++) { if (eth_conf->txmode.offloads & tx_offload_map[i].flags) { - snprintf(mode->info, sizeof(mode->info), "%s", - tx_offload_map[i].output); + strlcpy(mode->info, tx_offload_map[i].output, + sizeof(mode->info)); ret = 0; break; } diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 679f33ae1a08..baa1c2d1ea0f 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -313,8 +313,8 @@ dpaa2_dev_rx_burst_mode_get(struct rte_eth_dev *dev, /* Update Rx offload info */ for (i = 0; i < RTE_DIM(rx_offload_map); i++) { if (eth_conf->rxmode.offloads & rx_offload_map[i].flags) { - snprintf(mode->info, sizeof(mode->info), "%s", - rx_offload_map[i].output); + strlcpy(mode->info, rx_offload_map[i].output, + sizeof(mode->info)); ret = 0; break; } @@ -348,8 +348,8 @@ dpaa2_dev_tx_burst_mode_get(struct rte_eth_dev *dev, /* Update Tx offload info */ for (i = 0; i < RTE_DIM(tx_offload_map); i++) { if (eth_conf->txmode.offloads & tx_offload_map[i].flags) { - snprintf(mode->info, sizeof(mode->info), "%s", - tx_offload_map[i].output); + strlcpy(mode->info, tx_offload_map[i].output, + sizeof(mode->info)); ret = 0; break; } -- 2.39.2