summaryrefslogtreecommitdiff
path: root/sound/firewire/oxfw
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2023-09-15 10:27:59 +0200
committerTakashi Iwai <tiwai@suse.de>2023-09-15 13:21:50 +0200
commit641e969114c781ff269e1bf1b1f8d3cc33bc4a1a (patch)
treeab447063eb38d35ba4861f65b691dfcf90be56c7 /sound/firewire/oxfw
parent7272b8bfba35b2333b33d77f73ce75ee161880c2 (diff)
downloadlwn-641e969114c781ff269e1bf1b1f8d3cc33bc4a1a.tar.gz
lwn-641e969114c781ff269e1bf1b1f8d3cc33bc4a1a.zip
ALSA: firewire: Fix -Wformat-truncation warning for longname string
The filling of card->longname can be gracefully truncated, as it's only informative. Use scnprintf() and suppress the superfluous compile warning with -Wformat-truncation. Link: https://lore.kernel.org/r/20230915082802.28684-11-tiwai@suse.de Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/oxfw')
-rw-r--r--sound/firewire/oxfw/oxfw.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c
index 63d40f1a914f..241a697ce26b 100644
--- a/sound/firewire/oxfw/oxfw.c
+++ b/sound/firewire/oxfw/oxfw.c
@@ -108,11 +108,11 @@ static int name_card(struct snd_oxfw *oxfw, const struct ieee1394_device_id *ent
strcpy(oxfw->card->mixername, m);
strcpy(oxfw->card->shortname, m);
- snprintf(oxfw->card->longname, sizeof(oxfw->card->longname),
- "%s %s (OXFW%x %04x), GUID %08x%08x at %s, S%d",
- v, m, firmware >> 20, firmware & 0xffff,
- fw_dev->config_rom[3], fw_dev->config_rom[4],
- dev_name(&oxfw->unit->device), 100 << fw_dev->max_speed);
+ scnprintf(oxfw->card->longname, sizeof(oxfw->card->longname),
+ "%s %s (OXFW%x %04x), GUID %08x%08x at %s, S%d",
+ v, m, firmware >> 20, firmware & 0xffff,
+ fw_dev->config_rom[3], fw_dev->config_rom[4],
+ dev_name(&oxfw->unit->device), 100 << fw_dev->max_speed);
end:
return err;
}