linux-stable/sound/usb
Gustavo A. R. Silva 6c8019d08e ALSA: usb-midi: Replace zero-length array with flexible-array member
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertenly introduced[3] to the codebase from now on.

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 7649773293 ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Link: https://lore.kernel.org/r/20200211194224.GA9383@embeddedor
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-02-12 08:14:45 +01:00
..
6fire ALSA: usb: Constify snd_kcontrol_new items 2020-01-03 09:24:34 +01:00
bcd2000 ALSA: bcd2000: More constifications 2020-01-05 16:14:49 +01:00
caiaq ALSA: caiaq: More constifications 2020-01-05 16:14:37 +01:00
hiface ALSA: usb: Drop superfluous ioctl PCM ops 2019-12-11 07:25:34 +01:00
line6 ALSA: line6: Constify snd_ratden definitions 2020-01-03 09:24:40 +01:00
misc ALSA: usb: Drop superfluous ioctl PCM ops 2019-12-11 07:25:34 +01:00
usx2y ALSA: usx2y: More constifications 2020-01-05 16:14:47 +01:00
card.c ALSA: usb-audio: unlock on error in probe 2020-01-15 20:26:09 +01:00
card.h ALSA: usb-audio: set the interface format after resume on Dell WD19 2019-12-18 20:04:37 +01:00
clock.c ALSA: usb-audio: sound: usb: usb true/false for bool return type 2019-10-30 08:46:33 +01:00
clock.h ALSA: usb: initial USB Audio Device Class 3.0 support 2018-03-21 11:46:33 +01:00
debug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
endpoint.c ALSA: usb-audio: not submit urb for stopped endpoint 2019-11-13 10:49:31 +01:00
endpoint.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
format.c Merge branch 'for-linus' into for-next 2020-01-26 09:31:41 +01:00
format.h ALSA: usb: initial USB Audio Device Class 3.0 support 2018-03-21 11:46:33 +01:00
helper.c ALSA: usb-audio: Fix gpf in snd_usb_pipe_sanity_check 2019-07-30 12:32:21 +02:00
helper.h ALSA: usb-audio: More validations of descriptor units 2019-08-22 10:35:59 +02:00
Kconfig sound: Fix Kconfig indentation 2019-10-07 03:53:03 +02:00
Makefile Merge branch 'topic/usb-validation' into for-next 2019-08-22 15:42:03 +02:00
media.c media: sound/usb: Use Media Controller API to share media resources 2019-04-22 11:21:06 -04:00
media.h media: sound/usb: Use Media Controller API to share media resources 2019-04-22 11:21:06 -04:00
midi.c ALSA: usb-midi: Replace zero-length array with flexible-array member 2020-02-12 08:14:45 +01:00
midi.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mixer.c ALSA: usb-audio: More constifications 2020-01-05 16:14:34 +01:00
mixer.h ALSA: usb: Constify snd_kcontrol_new items 2020-01-03 09:24:34 +01:00
mixer_maps.c ALSA: usb-audio: More constifications 2020-01-05 16:14:34 +01:00
mixer_quirks.c ALSA: usb: update old-style static const declaration 2020-01-12 09:45:17 +01:00
mixer_quirks.h ALSA: usb-audio: Initialize Dell Dock playback volumes 2018-05-02 16:02:32 +02:00
mixer_scarlett.c ALSA: usb-audio: More constifications 2020-01-05 16:14:34 +01:00
mixer_scarlett.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mixer_scarlett_gen2.c ALSA: usb-audio: Annotate endianess in Scarlett gen2 quirk 2020-02-01 09:06:24 +01:00
mixer_scarlett_gen2.h ALSA: usb-audio: Scarlett Gen 2 mixer interface 2019-07-28 17:47:48 +02:00
mixer_us16x08.c ALSA: usb: Constify snd_kcontrol_new items 2020-01-03 09:24:34 +01:00
mixer_us16x08.h ALSA: usb: Constify snd_kcontrol_new items 2020-01-03 09:24:34 +01:00
pcm.c Merge branch 'for-linus' into for-next 2020-01-20 11:44:51 +01:00
pcm.h ALSA: usb-audio: Add UAC3 Power Domains to suspend/resume 2018-07-31 15:01:36 +02:00
power.c ALSA: usb-audio: More validations of descriptor units 2019-08-22 10:35:59 +02:00
power.h ALSA: usb-audio: Initial Power Domain support 2018-07-31 15:01:22 +02:00
proc.c ALSA: usb-audio: Use pcm_for_each_format() macro for PCM format iterations 2020-02-10 08:27:19 +01:00
proc.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
quirks-table.h ALSA: usb-audio: set the interface format after resume on Dell WD19 2019-12-18 20:04:37 +01:00
quirks.c ALSA: usb-audio: Add boot quirk for MOTU M Series 2020-01-13 10:47:56 +01:00
quirks.h ALSA: usb-audio: Add boot quirk for MOTU M Series 2020-01-13 10:47:56 +01:00
stream.c ALSA: usb-audio: More constifications 2020-01-05 16:14:34 +01:00
stream.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
usbaudio.h ALSA: usb-audio: set the interface format after resume on Dell WD19 2019-12-18 20:04:37 +01:00
validate.c ALSA: usb-audio: Fix endianess in descriptor validation 2020-02-01 09:06:11 +01:00