Skip to content

Commit 1e97acf

Browse files
committed
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/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 399245d commit 1e97acf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sound/isa/es1688/es1688.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ static int snd_es1688_probe(struct snd_card *card, unsigned int n)
130130

131131
strscpy(card->driver, "ES1688", sizeof(card->driver));
132132
strscpy(card->shortname, chip->pcm->name, sizeof(card->shortname));
133-
snprintf(card->longname, sizeof(card->longname),
134-
"%s at 0x%lx, irq %i, dma %i", chip->pcm->name, chip->port,
135-
chip->irq, chip->dma8);
133+
scnprintf(card->longname, sizeof(card->longname),
134+
"%s at 0x%lx, irq %i, dma %i", chip->pcm->name, chip->port,
135+
chip->irq, chip->dma8);
136136

137137
if (fm_port[n] == SNDRV_AUTO_PORT)
138138
fm_port[n] = port[n]; /* share the same port */

0 commit comments

Comments
 (0)