Skip to content

Commit 495667d

Browse files
arndbsudeep-holla
authored andcommitted
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: 3a7d93d ("firmware: arm_scmi: Use dev_err_probe to bail out") Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sudeep Holla <[email protected]>
1 parent 3a7d93d commit 495667d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/firmware/arm_scmi/driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2933,7 +2933,7 @@ static int scmi_probe(struct platform_device *pdev)
29332933
if (ret) {
29342934
err_str = "unable to communicate with SCMI\n";
29352935
if (coex) {
2936-
dev_err(dev, err_str);
2936+
dev_err(dev, "%s", err_str);
29372937
return 0;
29382938
}
29392939
goto notification_exit;
@@ -2990,7 +2990,7 @@ static int scmi_probe(struct platform_device *pdev)
29902990
clear_ida:
29912991
ida_free(&scmi_id, info->id);
29922992

2993-
return dev_err_probe(dev, ret, err_str);
2993+
return dev_err_probe(dev, ret, "%s", err_str);
29942994
}
29952995

29962996
static void scmi_remove(struct platform_device *pdev)

0 commit comments

Comments
 (0)