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 EDA3C42C04; Thu, 1 Jun 2023 17:05:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6E87D42B8B; Thu, 1 Jun 2023 17:01:43 +0200 (CEST) Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by mails.dpdk.org (Postfix) with ESMTP id 82A6542FB0 for ; Thu, 1 Jun 2023 17:01:40 +0200 (CEST) Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-52c30fa5271so381933a12.0 for ; Thu, 01 Jun 2023 08:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1685631699; x=1688223699; 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=cqMUF35ogrk7JxGsEvY3cD/eBWCmp0e7y14xdvFfCuI=; b=RBt8VPD/Ssq4dtekJQS6KQ+fUNYIzJNlVHEWXqBmmsY/8GIjLAFgw3ZXjDaWoxU/E3 mhC+zu+7ZB54cqkPyXvs2WBeoPv2JI/7lHY/uPH0kZTXoH2DrCSeapABkKTwXuPL0TVQ 1uWV4+PnOQhtEXcylboMxMPSJSoJI1ap1E0oQ7oLmuwRPhdcCrrYK8qkjS+Z8GD33Jgb vtWbw1tLyQXUh2pF2HGy8bUeEbhpxGwU/DLOaIjKA1+BVB4/0M8x9ouSAQYWhjQojfb6 +KcoO/oIo9GSut7M5nrO5kZgoCjcoMAx9SoSiszEwLEjNsGahT9z5NPmtN8ruN6sL2xY qYwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685631699; x=1688223699; 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=cqMUF35ogrk7JxGsEvY3cD/eBWCmp0e7y14xdvFfCuI=; b=Q1JTzrIUdwmD6qfUIrgTo+yQRCyLTk/bc8cFPLBu5uEImVeTwOcZ4+KRNCEKuXrffG tYsw7s6DfZwCLF9v8iLH2feqsxYUHc25Xxy8oI6RCa80+iz748WqsN3/f/TPdn34OmOm KgLezOPGt4JnX93ikOajHBm1UdCeimehn4Oo2iCvTvjEalaD/lOj4u1NSAIXTytlTO0x lodqJan36Ij0pv6SDblFqCKmJt0bnxvnOZPcyKu8HqjPwr6xUHN9zLF5MpTcpDy+TAuk ymNo0eMlWVgOyfCxuQMRH8yNdTiGz9wWE2Uk8TOTfNSSYA7VPn85Ciz1oow4NT2A4amJ PvfA== X-Gm-Message-State: AC+VfDzjocinTPxFs8tseSgUC2UNM+wRuvXDphXWmSFJc8Ks1x09gYww hYHuuEZMTAzUM1+ke8A10/z3a2mHTxUJP4/62+++Xw== X-Google-Smtp-Source: ACHHUZ4hTKdnXvZ5zBmsjDSaomNqAbHCRsNrgjy/CaycKwip651Fq/dBELQKlGeT70nqgox7ljYV9Q== X-Received: by 2002:a17:902:bb8f:b0:1af:daf4:b6f1 with SMTP id m15-20020a170902bb8f00b001afdaf4b6f1mr5365964pls.38.1685631699384; Thu, 01 Jun 2023 08:01:39 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 08:01:38 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Devendra Singh Rawat , Alok Prasad Subject: [PATCH 24/25] net/qede: replace snprintf with strlcpy Date: Thu, 1 Jun 2023 08:01:05 -0700 Message-Id: <20230601150106.18375-25-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/qede/qede_ethdev.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index a4923670d6ba..7429ec3e8773 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -238,8 +238,8 @@ qede_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size) size_t size; if (IS_PF(edev)) - snprintf(ver_str, QEDE_PMD_DRV_VER_STR_SIZE, "%s", - QEDE_PMD_FW_VERSION); + strlcpy(ver_str, QEDE_PMD_FW_VERSION, + QEDE_PMD_DRV_VER_STR_SIZE); else snprintf(ver_str, QEDE_PMD_DRV_VER_STR_SIZE, "%d.%d.%d.%d", info->fw_major, info->fw_minor, @@ -374,11 +374,9 @@ static void qede_print_adapter_info(struct rte_eth_dev *dev) ECORE_IS_BB(edev) ? "BB" : "AH", 'A' + edev->chip_rev, (int)edev->chip_metal); - snprintf(ver_str, QEDE_PMD_DRV_VER_STR_SIZE, "%s", - QEDE_PMD_DRV_VERSION); + strlcpy(ver_str, QEDE_PMD_DRV_VERSION, QEDE_PMD_DRV_VER_STR_SIZE); DP_INFO(edev, " %-20s: %s\n", "Driver version", ver_str); - snprintf(ver_str, QEDE_PMD_DRV_VER_STR_SIZE, "%s", - QEDE_PMD_BASE_VERSION); + strlcpy(ver_str, QEDE_PMD_BASE_VERSION, QEDE_PMD_DRV_VER_STR_SIZE); DP_INFO(edev, " %-20s: %s\n", "Base version", ver_str); qede_fw_version_get(dev, ver_str, sizeof(ver_str)); DP_INFO(edev, " %-20s: %s\n", "Firmware version", ver_str); -- 2.39.2