mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-17 05:45:20 +00:00
ALSA: cs4231: 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/20230915091313.5988-3-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
60a9c7f7fb
commit
ba8bb7dce1
@ -98,11 +98,11 @@ static int snd_cs4231_probe(struct device *dev, unsigned int n)
|
||||
strscpy(card->shortname, chip->pcm->name, sizeof(card->shortname));
|
||||
|
||||
if (dma2[n] < 0)
|
||||
snprintf(card->longname, sizeof(card->longname),
|
||||
scnprintf(card->longname, sizeof(card->longname),
|
||||
"%s at 0x%lx, irq %d, dma %d",
|
||||
chip->pcm->name, chip->port, irq[n], dma1[n]);
|
||||
else
|
||||
snprintf(card->longname, sizeof(card->longname),
|
||||
scnprintf(card->longname, sizeof(card->longname),
|
||||
"%s at 0x%lx, irq %d, dma %d&%d",
|
||||
chip->pcm->name, chip->port, irq[n], dma1[n], dma2[n]);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user