Commit 1e97acf3 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

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: default avatarTakashi Iwai <tiwai@suse.de>
parent 399245d3
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ static int snd_es1688_probe(struct snd_card *card, unsigned int n)

	strscpy(card->driver, "ES1688", sizeof(card->driver));
	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,
		  chip->irq, chip->dma8);