summaryrefslogtreecommitdiffstats
path: root/sound/soc/amd/ps
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2023-09-15 10:22:07 +0200
committerMark Brown <broonie@kernel.org>2023-09-15 14:16:25 +0200
commit925819c7969cc1453a3e8125787942d6127fa002 (patch)
tree5ef4b08b366c6c542819a819c26b6de8954e6d9e /sound/soc/amd/ps
parentASoC: rt1015: fix the first word being cut off (diff)
downloadlinux-925819c7969cc1453a3e8125787942d6127fa002.tar.xz
linux-925819c7969cc1453a3e8125787942d6127fa002.zip
ASoC: amd: ps: Fix -Wformat-truncation warning
The compile warning with -Wformat-truncation at sdw_amd_scan_controller() is false-positive; the max loop size is AMD_SDW_MAX_MANAGERS (= 2), hence it fits with the given size. For suppressing the warning, replace snprintf() with scnprintf(). As stated in the above, truncation doesn't matter. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20230915082207.26200-1-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd/ps')
-rw-r--r--sound/soc/amd/ps/pci-ps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c
index 4af3c3665387..7e4c0ec9e56c 100644
--- a/sound/soc/amd/ps/pci-ps.c
+++ b/sound/soc/amd/ps/pci-ps.c
@@ -274,7 +274,7 @@ static int sdw_amd_scan_controller(struct device *dev)
dev_dbg(dev, "ACPI reports %d SoundWire Manager devices\n", count);
acp_data->sdw_manager_count = count;
for (index = 0; index < count; index++) {
- snprintf(name, sizeof(name), "mipi-sdw-link-%d-subproperties", index);
+ scnprintf(name, sizeof(name), "mipi-sdw-link-%d-subproperties", index);
link = fwnode_get_named_child_node(acp_data->sdw_fw_node, name);
if (!link) {
dev_err(dev, "Manager node %s not found\n", name);