mirror of
https://github.com/torvalds/linux
synced 2024-09-06 09:51:23 +00:00
ALSA: es1688: 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-8-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
399245d304
commit
1e97acf3a6
|
@ -130,9 +130,9 @@ static int snd_es1688_probe(struct snd_card *card, unsigned int n)
|
||||||
|
|
||||||
strscpy(card->driver, "ES1688", sizeof(card->driver));
|
strscpy(card->driver, "ES1688", sizeof(card->driver));
|
||||||
strscpy(card->shortname, chip->pcm->name, sizeof(card->shortname));
|
strscpy(card->shortname, chip->pcm->name, sizeof(card->shortname));
|
||||||
snprintf(card->longname, sizeof(card->longname),
|
scnprintf(card->longname, sizeof(card->longname),
|
||||||
"%s at 0x%lx, irq %i, dma %i", chip->pcm->name, chip->port,
|
"%s at 0x%lx, irq %i, dma %i", chip->pcm->name, chip->port,
|
||||||
chip->irq, chip->dma8);
|
chip->irq, chip->dma8);
|
||||||
|
|
||||||
if (fm_port[n] == SNDRV_AUTO_PORT)
|
if (fm_port[n] == SNDRV_AUTO_PORT)
|
||||||
fm_port[n] = port[n]; /* share the same port */
|
fm_port[n] = port[n]; /* share the same port */
|
||||||
|
|
Loading…
Reference in a new issue