Skip to content

Commit 399245d

Browse files
committed
ALSA: cs4236: 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 2a47145 commit 399245d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sound/isa/cs423x/cs4236.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -367,14 +367,14 @@ static int snd_cs423x_probe(struct snd_card *card, int dev)
367367
strscpy(card->driver, chip->pcm->name, sizeof(card->driver));
368368
strscpy(card->shortname, chip->pcm->name, sizeof(card->shortname));
369369
if (dma2[dev] < 0)
370-
snprintf(card->longname, sizeof(card->longname),
371-
"%s at 0x%lx, irq %i, dma %i",
372-
chip->pcm->name, chip->port, irq[dev], dma1[dev]);
370+
scnprintf(card->longname, sizeof(card->longname),
371+
"%s at 0x%lx, irq %i, dma %i",
372+
chip->pcm->name, chip->port, irq[dev], dma1[dev]);
373373
else
374-
snprintf(card->longname, sizeof(card->longname),
375-
"%s at 0x%lx, irq %i, dma %i&%d",
376-
chip->pcm->name, chip->port, irq[dev], dma1[dev],
377-
dma2[dev]);
374+
scnprintf(card->longname, sizeof(card->longname),
375+
"%s at 0x%lx, irq %i, dma %i&%d",
376+
chip->pcm->name, chip->port, irq[dev], dma1[dev],
377+
dma2[dev]);
378378

379379
err = snd_wss_timer(chip, 0);
380380
if (err < 0)

0 commit comments

Comments
 (0)