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 91C1A42C04; Thu, 1 Jun 2023 17:05:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05A4742FA8; Thu, 1 Jun 2023 17:01:40 +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 7C2AD42F86 for ; Thu, 1 Jun 2023 17:01:37 +0200 (CEST) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1b03b9f02b4so4210575ad.3 for ; Thu, 01 Jun 2023 08:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1685631696; x=1688223696; 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=I7tekuFDxD/Cu8II9jNd6w/r+xZWRdRrnuBjlBGaNE4=; b=pTqDWigAo/RvAp3IRokC0LE2SblZbMbnpeBpnA1v5LtNuZrPL+uSHYVFuyvVOmS9+F sN42bIZazRvqtAexexih/Fd9iFzPrEE9Vos1vmgI+pq+ue1S1mhXokguCpU0EPmmWUJv FX5lbWUgRx2HiLbwP5D8dw9q3S6TEquc+X22eMS/Q8Gw9zjCVHdtNC3A1fn5PsWMbg1n St7vP6/Dk8ezMbyTVT/oBwBgBo8Cx44Yc4Qd8o8mRoaGr5Lm24KLjbaT0fOfVfIgtDjq tVTGjC+iC2YuZI9xyPW/rM0K+t5ces+NlzIFdm1V2/5XXIp+VnGNXc5gOO1TW2lvD4sq kK8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685631696; x=1688223696; 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=I7tekuFDxD/Cu8II9jNd6w/r+xZWRdRrnuBjlBGaNE4=; b=btinyWtPRmnqZlqqOxlksA8xxkIcED587z8vpgSoXRt9oY+yqgd9hu58kfSY4lSGAC p2gcJr7sgQYL02zr3J43WmqlF2qxKaE2NjoSLLNNSyIMOKUW4bKYd4W0a5hcjKF6PxBo NnvV5FycxTH9BzjrPilunBRp8cxgzabMf1k63OL/s7zx6QXDjspod/crptaV7itjYqrY l7ETde4UTIVENhrku3R9IJPnqvQz6aF9ufgAGli5BXkHf2SNGxkc5faDMrEmzgjdvGHX MMgrMw0d0VOkkDdjqlmBEVgA6rQfKkxRDReVWBtTascsIdVISFZ/lpJUEnozXNwqvpZq RXYw== X-Gm-Message-State: AC+VfDwXQKs4lOeGtBWoCLJGNfSmDilIsDfdf9sbuW1oredxKOImvxwR uOJKSsA8JshwHqJP6W6WuVuwZl75yeHK4FzkOY3OCg== X-Google-Smtp-Source: ACHHUZ6Z82Lwk1LOXHCaeY8SfrFMn3A/e0VtlYSTKJzxvSIQ9RKaaZGOQ2I5Mjk6EytPwLf8aguJwQ== X-Received: by 2002:a17:902:da8f:b0:1b1:a4b8:4f23 with SMTP id j15-20020a170902da8f00b001b1a4b84f23mr1064095plx.24.1685631696450; Thu, 01 Jun 2023 08:01:36 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 08:01:36 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Matan Azrad , Viacheslav Ovsiienko , Ori Kam , Suanming Mou Subject: [PATCH 21/25] net/mlx5: replace snprintf with strlcpy Date: Thu, 1 Jun 2023 08:01:02 -0700 Message-Id: <20230601150106.18375-22-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/mlx5/mlx5_rx.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c index a2be523e9e36..5d0ec51f2a19 100644 --- a/drivers/net/mlx5/mlx5_rx.c +++ b/drivers/net/mlx5/mlx5_rx.c @@ -219,26 +219,26 @@ mlx5_rx_burst_mode_get(struct rte_eth_dev *dev, return -rte_errno; } if (pkt_burst == mlx5_rx_burst) { - snprintf(mode->info, sizeof(mode->info), "%s", "Scalar"); + strlcpy(mode->info, "Scalar", sizeof(mode->info)); } else if (pkt_burst == mlx5_rx_burst_mprq) { - snprintf(mode->info, sizeof(mode->info), "%s", "Multi-Packet RQ"); + strlcpy(mode->info, "Multi-Packet RQ", sizeof(mode->info)); } else if (pkt_burst == mlx5_rx_burst_vec) { #if defined RTE_ARCH_X86_64 - snprintf(mode->info, sizeof(mode->info), "%s", "Vector SSE"); + strlcpy(mode->info, "Vector SSE", sizeof(mode->info)); #elif defined RTE_ARCH_ARM64 - snprintf(mode->info, sizeof(mode->info), "%s", "Vector Neon"); + strlcpy(mode->info, "Vector Neon", sizeof(mode->info)); #elif defined RTE_ARCH_PPC_64 - snprintf(mode->info, sizeof(mode->info), "%s", "Vector AltiVec"); + strlcpy(mode->info, "Vector AltiVec", sizeof(mode->info)); #else return -EINVAL; #endif } else if (pkt_burst == mlx5_rx_burst_mprq_vec) { #if defined RTE_ARCH_X86_64 - snprintf(mode->info, sizeof(mode->info), "%s", "MPRQ Vector SSE"); + strlcpy(mode->info, "MPRQ Vector SSE", sizeof(mode->info)); #elif defined RTE_ARCH_ARM64 - snprintf(mode->info, sizeof(mode->info), "%s", "MPRQ Vector Neon"); + strlcpy(mode->info, "MPRQ Vector Neon", sizeof(mode->info)); #elif defined RTE_ARCH_PPC_64 - snprintf(mode->info, sizeof(mode->info), "%s", "MPRQ Vector AltiVec"); + strlcpy(mode->info, "MPRQ Vector AltiVec", sizeof(mode->info)); #else return -EINVAL; #endif -- 2.39.2