From patchwork Wed Apr 3 11:10:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13615933 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D5C7CD128A for ; Wed, 3 Apr 2024 11:11:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Jf9JffF3IdPDYA9L+H1KBb+/by1NimshiWIKU+yWA68=; b=ooL64pIMYc3vt0 fWWjb33ZSiCc+cZmXGT+b3z9wMk67h8A9E6pptdr4IwycoCBPSd26DaCWhBnEcDDi29EC1nvy7ypd BJCpBU1lWzVbO4yoFOZhUdWi3KdES+Gy/Vzi9jpYYX9sc70T4JR9axxKjq50mUwhjPoIRavCVGTRh nww2bf/Llj/n/3DllevDRC9N1OJZOtK1MkYvKPa+bH9+W7YryuEKJv6Hwr+X82QtQXt6+WG7g5w+m TEIdY/ldcqJDvIX1hFd1q7peDrL1P6YgiKInmSxX//FSDdmu7OJLrobYirCYX0mweBKuw2D44A6k9 rz62KAZRnAf0L79RzIGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rryW3-0000000Fihm-04ID; Wed, 03 Apr 2024 11:10:51 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rryW0-0000000FigT-1FOq for linux-arm-kernel@lists.infradead.org; Wed, 03 Apr 2024 11:10:49 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id AF07C61077; Wed, 3 Apr 2024 11:10:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF05CC433F1; Wed, 3 Apr 2024 11:10:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712142646; bh=yemH83Y1IBRrxs46KNsj+mhkx+dw4Xz7CPBdGbd26JA=; h=From:To:Cc:Subject:Date:From; b=p8OpL00wcZVyQKOBcHjcsrO2JtE29/xzGT0Gm/uzql1T88/EYGguTdJTo4G+RluYH 4PJ3QF4DDjlmPalPT9IFnXWYuk8bEmWM0AXG3wzvWJGLeabh7IlGUxYFHdG+H/HVIn ng39qgroZoJ62mm7YlyhKTfC4NGLh0qy2OAJ1dhZI4muA4LhpG11rWrjdL+njYfDMo 1M4oWR2oLmk+v4PW5MvlFCOQCbNFnBbuvQqYuaQUnZioz5HzbvQtiBd/ElkRQZdNyO Y1Mes2KzffMbvkeR/I2dKYRHgCDeCkEmadaNLkA7zk1eWRNf5Z5tmaNVK9Q/XpuMp4 l1HG00ANDz4jg== From: Arnd Bergmann To: Sudeep Holla , Cristian Marussi Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Nikunj Kela , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] firmware: arm_scmi: Avoid non-constant printk format strings Date: Wed, 3 Apr 2024 13:10:24 +0200 Message-Id: <20240403111040.3924658-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240403_041048_477183_7DF89C8B X-CRM114-Status: GOOD ( 12.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Arnd Bergmann A recent rework changed the constant format strings to a local variable, which causes warnings from clang when -Wformat-security is enabled: drivers/firmware/arm_scmi/driver.c: In function 'scmi_probe': drivers/firmware/arm_scmi/driver.c:2936:25: error: format not a string literal and no format arguments [-Werror=format-security] 2936 | dev_err(dev, err_str); | ^~~~~~~ drivers/firmware/arm_scmi/driver.c:2993:9: error: format not a string literal and no format arguments [-Werror=format-security] 2993 | return dev_err_probe(dev, ret, err_str); Print these using an explicit "%s" string instead. Fixes: 3a7d93d1f71b ("firmware: arm_scmi: Use dev_err_probe to bail out") Signed-off-by: Arnd Bergmann --- drivers/firmware/arm_scmi/driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index d0091459a276..36e3eb50a8d4 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -2933,7 +2933,7 @@ static int scmi_probe(struct platform_device *pdev) if (ret) { err_str = "unable to communicate with SCMI\n"; if (coex) { - dev_err(dev, err_str); + dev_err(dev, "%s", err_str); return 0; } goto notification_exit; @@ -2990,7 +2990,7 @@ static int scmi_probe(struct platform_device *pdev) clear_ida: ida_free(&scmi_id, info->id); - return dev_err_probe(dev, ret, err_str); + return dev_err_probe(dev, ret, "%s", err_str); } static void scmi_remove(struct platform_device *pdev)