summaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-07-26 14:58:03 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-13 09:22:29 +0100
commita6d3f0246e258a0d57eda8d15810ed60b72265a0 (patch)
treedcd73bac6b714bc643c6d559962de77c9b589fca /sound/pci
parentefb4251b4eba1ba4507f76d68fbef7cdc9ec0db2 (diff)
downloadlinux-stable-a6d3f0246e258a0d57eda8d15810ed60b72265a0.tar.gz
linux-stable-a6d3f0246e258a0d57eda8d15810ed60b72265a0.tar.bz2
linux-stable-a6d3f0246e258a0d57eda8d15810ed60b72265a0.zip
ALSA: trident: Suppress gcc string warning
commit d6b340d7cb33c816ef4abe8143764ec5ab14a5cc upstream. The meddlesome gcc warns about the possible shortname string in trident driver code: sound/pci/trident/trident.c: In function ‘snd_trident_probe’: sound/pci/trident/trident.c:126:2: warning: ‘strcat’ accessing 17 or more bytes at offsets 36 and 20 may overlap 1 byte at offset 36 [-Wrestrict] strcat(card->shortname, card->driver); It happens since gcc calculates the possible string size from card->driver, but this can't be true since we did set the string just before that, and they are much shorter. For shutting it up, use the exactly same string set to card->driver for strcat() to card->shortname, too. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/trident/trident.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c
index a54cd6879b31..89ceda5c6979 100644
--- a/sound/pci/trident/trident.c
+++ b/sound/pci/trident/trident.c
@@ -123,7 +123,7 @@ static int snd_trident_probe(struct pci_dev *pci,
} else {
strcpy(card->shortname, "Trident ");
}
- strcat(card->shortname, card->driver);
+ strcat(card->shortname, str);
sprintf(card->longname, "%s PCI Audio at 0x%lx, irq %d",
card->shortname, trident->port, trident->irq);