Commit ba8bb7dc authored by Takashi Iwai's avatar Takashi Iwai

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.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 60a9c7f7
...@@ -98,13 +98,13 @@ static int snd_cs4231_probe(struct device *dev, unsigned int n) ...@@ -98,13 +98,13 @@ static int snd_cs4231_probe(struct device *dev, unsigned int n)
strscpy(card->shortname, chip->pcm->name, sizeof(card->shortname)); strscpy(card->shortname, chip->pcm->name, sizeof(card->shortname));
if (dma2[n] < 0) if (dma2[n] < 0)
snprintf(card->longname, sizeof(card->longname), scnprintf(card->longname, sizeof(card->longname),
"%s at 0x%lx, irq %d, dma %d", "%s at 0x%lx, irq %d, dma %d",
chip->pcm->name, chip->port, irq[n], dma1[n]); chip->pcm->name, chip->port, irq[n], dma1[n]);
else else
snprintf(card->longname, sizeof(card->longname), scnprintf(card->longname, sizeof(card->longname),
"%s at 0x%lx, irq %d, dma %d&%d", "%s at 0x%lx, irq %d, dma %d&%d",
chip->pcm->name, chip->port, irq[n], dma1[n], dma2[n]); chip->pcm->name, chip->port, irq[n], dma1[n], dma2[n]);
error = snd_wss_mixer(chip); error = snd_wss_mixer(chip);
if (error < 0) if (error < 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