mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
ALSA: opti9x: 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-9-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
1e97acf3a6
commit
bc44e10abb
@ -1344,7 +1344,7 @@ static int snd_miro_probe(struct snd_card *card)
|
||||
}
|
||||
|
||||
strcpy(card->driver, "miro");
|
||||
snprintf(card->longname, sizeof(card->longname),
|
||||
scnprintf(card->longname, sizeof(card->longname),
|
||||
"%s: OPTi%s, %s at 0x%lx, irq %d, dma %d&%d",
|
||||
card->shortname, miro->name, codec->pcm->name,
|
||||
miro->wss_base + 4, miro->irq, miro->dma1, miro->dma2);
|
||||
|
@ -859,12 +859,12 @@ static int snd_opti9xx_probe(struct snd_card *card)
|
||||
strcpy(card->driver, chip->name);
|
||||
sprintf(card->shortname, "OPTi %s", card->driver);
|
||||
#if defined(CS4231) || defined(OPTi93X)
|
||||
snprintf(card->longname, sizeof(card->longname),
|
||||
scnprintf(card->longname, sizeof(card->longname),
|
||||
"%s, %s at 0x%lx, irq %d, dma %d&%d",
|
||||
card->shortname, codec->pcm->name,
|
||||
chip->wss_base + 4, irq, dma1, xdma2);
|
||||
#else
|
||||
snprintf(card->longname, sizeof(card->longname),
|
||||
scnprintf(card->longname, sizeof(card->longname),
|
||||
"%s, %s at 0x%lx, irq %d, dma %d",
|
||||
card->shortname, codec->pcm->name, chip->wss_base + 4, irq,
|
||||
dma1);
|
||||
|
Loading…
Reference in New Issue
Block a user