Received: by 2002:ab2:f03:0:b0:1ef:ffd0:ce49 with SMTP id i3csp91328lqf; Tue, 26 Mar 2024 15:41:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXZx17U8kXp7jjK028M7KEuS0Rmt8QVgF1GDNTQVN2RPyGw+SPz+jh9WnBuH7tpIuDBJJ72Hj323VZ1jyn26zFXc7g5uKyPv7vrLvxvxg== X-Google-Smtp-Source: AGHT+IFvNzSnh+wbddxM0F92YDoDbgZ4dDn6qw5BpNL5tN4X0ExP6iLm4c+j2Xjh3WtcMsEcvO4s X-Received: by 2002:a05:6214:2a45:b0:696:7e64:1a3f with SMTP id jf5-20020a0562142a4500b006967e641a3fmr1142823qvb.57.1711492880352; Tue, 26 Mar 2024 15:41:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711492880; cv=pass; d=google.com; s=arc-20160816; b=MptqJmb6OKCxNCmm2d0E1THeBj7wnvpDsmfhDiXxO2GN57Dhb/JHTbz68QUzoBaLVs D6h4M1wNHClvEp5E/GKPA8hdez+uNGeWxKZOMiz3w5CNFuy105kLx2z9ddWMI1s1H06X HyVPkdybTAjDh41yL3hCSIeotn10k6vbMT1Jot1cKkoTP8n74BOJn7uZpbTm/NhVHcHr h/1mP6YprYualQlb0tPaaYNIRwNwtccMZOceddENYuXzbaB5E7kqAYtK5/pYWsm/OnWU t93X2QAJZrigwKejkzcRUG8GZbUcfeFH0BlmtHMs8nNAB+dBfrXwyIlx4IjXSWNPi+B+ jalQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=qhM5s6X7n+m4lcpqZ70ZS6PYoo8WfaLVZVbS+q40jiM=; fh=o3VUIlHvhaEqtXfS+mes1aBNqkKOoIR5vB5yrHG5aYQ=; b=NNLUoW7JAJrh0A8KhN7Lf/IweNQlKcZB4Yl3XJ/faKsMZ1JsacZ+VoFCSAzC+QNun+ oWipTkIWUIva+eYMvfaKm6BHp4OXNglRTBLy/tRJCoipLpCIts9wV9JDbFtY7vAOAbuf GSKyvVYts5ik0vOJNtf50XCA6nJJY8zPdD71dPkA2wPbr7sxgFCw45GQZofmdQmzJNTp lMyJdNBMKR50VT0RWkRe5O73pY694eqDo9q5uAssBMzRWryvJ9J8VGoDvEXXrXb83G5e n7lLE/NvGgUFQFSlTveoKRbx4ko8SlOXL80BuF2xjUZqf2u9+B6nOBGb8qOE8fiBOaH8 eHHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tmbfHnWP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-120078-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120078-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o11-20020ad45c8b000000b006910a72721dsi9981191qvh.230.2024.03.26.15.41.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 15:41:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120078-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tmbfHnWP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-120078-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120078-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 027EA1C3FF85 for ; Tue, 26 Mar 2024 22:41:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C043D13E05D; Tue, 26 Mar 2024 22:39:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tmbfHnWP" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B451313D8B2; Tue, 26 Mar 2024 22:39:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711492783; cv=none; b=qYuqV3xWW3HXGh34Nfm04xZaUGTPJdTls2k/x81fGWzdVUeHUvfO6aBpsl7Ryo9KF5wwUWQSs82ubWCW4dsY5NFv/OVjOSiilOIfSv9qFyu2E40XZ+GvatMfp6+nhlu0W3gLzcttyqdsQTRiznac/Y1ZHiNTTW88tB8vA+Hpecw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711492783; c=relaxed/simple; bh=F1tdxK6zhURX1XJa26Hj4NTFjwVssRlwDIPa82U+7Bs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GXu9h8AZaPMalcE7gbRiN5vT29EMNfItd/n0SZrTrFq1q0D8822jtBIG7jibmmNVQRhD/uelmHQV25OWMIguVC7iqW1npZk4aQxCLUtfu5wfyg8lq1LUSvMhCWxTDhhYdBMnMWaeJW9D7+ru/IrDWIrNPSIHeNvZeBo2cfFdd9k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tmbfHnWP; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE7F5C433C7; Tue, 26 Mar 2024 22:39:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711492783; bh=F1tdxK6zhURX1XJa26Hj4NTFjwVssRlwDIPa82U+7Bs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tmbfHnWPYV61Wv5iJoz7qdwrUEHhqEB2TZlr+P4RRDVAYgR6Nr/hl2wuXKgNBL69l T7Xxg4TYS4ANY2Ynz3yB2yl8CwY+YBN811GkOiH+8PnxmYpSj4YxykOrWs2v0PBxhH KbDjYSxvhYF/hxF5hmZ/9vbIUKqV6GZlnmxDMeLWYHBeQaFo5zhuV4ufReW5oXHLRs iSRCp7D4mUt9ukgZ4RHoZoQiHmTokGfajcZaKawN5oJ8Pq9+A56JIheUGJDhLLSAGR xlMuJniJZpuZvgowiLjFneTAqJ7NlJVshD7RJjwSUGPuUfKKYOvyKZ/IwC6whf469l MijLyYiwgnU5Q== From: Arnd Bergmann To: llvm@lists.linux.dev, Ariel Elior , Manish Chopra Cc: Arnd Bergmann , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Simon Horman , Konstantin Khorenko , Sudarsana Reddy Kalluru , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/9] qed: avoid truncating work queue length Date: Tue, 26 Mar 2024 23:38:02 +0100 Message-Id: <20240326223825.4084412-4-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240326223825.4084412-1-arnd@kernel.org> References: <20240326223825.4084412-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann clang complains that the temporary string for the name passed into alloc_workqueue() is too short for its contents: drivers/net/ethernet/qlogic/qed/qed_main.c:1218:3: error: 'snprintf' will always be truncated; specified size is 16, but format string expands to at least 18 [-Werror,-Wformat-truncation] There is no need for a temporary buffer, and the actual name of a workqueue is 32 bytes (WQ_NAME_LEN), so just use the interface as intended to avoid the truncation. Fixes: 59ccf86fe69a ("qed: Add driver infrastucture for handling mfw requests.") Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/qlogic/qed/qed_main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c index c278f8893042..8159b4c315b5 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_main.c +++ b/drivers/net/ethernet/qlogic/qed/qed_main.c @@ -1206,7 +1206,6 @@ static void qed_slowpath_task(struct work_struct *work) static int qed_slowpath_wq_start(struct qed_dev *cdev) { struct qed_hwfn *hwfn; - char name[NAME_SIZE]; int i; if (IS_VF(cdev)) @@ -1215,11 +1214,11 @@ static int qed_slowpath_wq_start(struct qed_dev *cdev) for_each_hwfn(cdev, i) { hwfn = &cdev->hwfns[i]; - snprintf(name, NAME_SIZE, "slowpath-%02x:%02x.%02x", - cdev->pdev->bus->number, - PCI_SLOT(cdev->pdev->devfn), hwfn->abs_pf_id); + hwfn->slowpath_wq = alloc_workqueue("slowpath-%02x:%02x.%02x", + 0, 0, cdev->pdev->bus->number, + PCI_SLOT(cdev->pdev->devfn), + hwfn->abs_pf_id); - hwfn->slowpath_wq = alloc_workqueue(name, 0, 0); if (!hwfn->slowpath_wq) { DP_NOTICE(hwfn, "Cannot create slowpath workqueue\n"); return -ENOMEM; -- 2.39.2