From: Arnd Bergmann Date: Wed, 3 Apr 2024 11:10:24 +0000 (+0200) Subject: firmware: arm_scmi: Avoid non-constant printk format strings X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=495667d49c5067ef4f732dcc44c9a7b0d7e98d39;p=linux.git firmware: arm_scmi: Avoid non-constant printk format strings 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 Link: https://lore.kernel.org/r/20240403111040.3924658-1-arnd@kernel.org Signed-off-by: Sudeep Holla --- diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index d0091459a276b..36e3eb50a8d42 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 @@ clear_txrx_setup: 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)