Skip to content

Commit 322e0c5

Browse files
committed
ALSA: riptide: Fix -Wformat-truncation warning for longname string
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 ba8bb7d commit 322e0c5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

sound/pci/riptide/riptide.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2105,15 +2105,15 @@ __snd_card_riptide_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
21052105
strcpy(card->driver, "RIPTIDE");
21062106
strcpy(card->shortname, "Riptide");
21072107
#ifdef SUPPORT_JOYSTICK
2108-
snprintf(card->longname, sizeof(card->longname),
2109-
"%s at 0x%lx, irq %i mpu 0x%x opl3 0x%x gameport 0x%x",
2110-
card->shortname, chip->port, chip->irq, chip->mpuaddr,
2111-
chip->opladdr, chip->gameaddr);
2108+
scnprintf(card->longname, sizeof(card->longname),
2109+
"%s at 0x%lx, irq %i mpu 0x%x opl3 0x%x gameport 0x%x",
2110+
card->shortname, chip->port, chip->irq, chip->mpuaddr,
2111+
chip->opladdr, chip->gameaddr);
21122112
#else
2113-
snprintf(card->longname, sizeof(card->longname),
2114-
"%s at 0x%lx, irq %i mpu 0x%x opl3 0x%x",
2115-
card->shortname, chip->port, chip->irq, chip->mpuaddr,
2116-
chip->opladdr);
2113+
scnprintf(card->longname, sizeof(card->longname),
2114+
"%s at 0x%lx, irq %i mpu 0x%x opl3 0x%x",
2115+
card->shortname, chip->port, chip->irq, chip->mpuaddr,
2116+
chip->opladdr);
21172117
#endif
21182118
snd_riptide_proc_init(chip);
21192119
err = snd_card_register(card);

0 commit comments

Comments
 (0)