Commit 399245d3 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: cs4236: Fix -Wformat-truncation warning

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-7-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 2a471452
......@@ -367,14 +367,14 @@ static int snd_cs423x_probe(struct snd_card *card, int dev)
strscpy(card->driver, chip->pcm->name, sizeof(card->driver));
strscpy(card->shortname, chip->pcm->name, sizeof(card->shortname));
if (dma2[dev] < 0)
snprintf(card->longname, sizeof(card->longname),
"%s at 0x%lx, irq %i, dma %i",
chip->pcm->name, chip->port, irq[dev], dma1[dev]);
scnprintf(card->longname, sizeof(card->longname),
"%s at 0x%lx, irq %i, dma %i",
chip->pcm->name, chip->port, irq[dev], dma1[dev]);
else
snprintf(card->longname, sizeof(card->longname),
"%s at 0x%lx, irq %i, dma %i&%d",
chip->pcm->name, chip->port, irq[dev], dma1[dev],
dma2[dev]);
scnprintf(card->longname, sizeof(card->longname),
"%s at 0x%lx, irq %i, dma %i&%d",
chip->pcm->name, chip->port, irq[dev], dma1[dev],
dma2[dev]);
err = snd_wss_timer(chip, 0);
if (err < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment