]> git.ipfire.org Git - people/arne_f/kernel.git/commit
ALSA: trident: Suppress gcc string warning
authorTakashi Iwai <tiwai@suse.de>
Thu, 26 Jul 2018 12:58:03 +0000 (14:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Dec 2018 12:05:06 +0000 (13:05 +0100)
commitb2b93631769364c4e40e8655d7e30915fddf69d3
tree727976c238c824ecff94c9e2edd895174b4775b0
parent5f41f8cacf643281dbb9027b06d4de37e5605f99
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>
sound/pci/trident/trident.c