linux/drivers/usb/gadget/function
Gustavo A. R. Silva b57a368efd usb: gadget: f_phonet: 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/20200211232303.GA21495@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 08:38:16 -08:00
..
f_acm.c usb: gadget: u_serial: allow more console gadget ports 2019-10-22 10:27:12 +03:00
f_ecm.c usb: gadget: f_ecm: Use atomic_t to track in-flight request 2020-01-15 10:40:22 +01:00
f_eem.c USB: gadget: function: fix issue Unneeded variable: "value" 2019-07-03 10:58:44 +03:00
f_fs.c Merge branch 'merge.nfs-fs_parse.1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-02-08 13:26:41 -08:00
f_hid.c USB: gadget: f_hid: fix deadlock in f_hidg_write() 2019-03-20 10:58:48 +02:00
f_loopback.c
f_mass_storage.c usb: gadget: mass_storage: Fix races between fsg_disable and fsg_set_alt 2019-08-12 08:55:24 +03:00
f_mass_storage.h
f_midi.c
f_ncm.c usb: gadget: f_ncm: Use atomic_t to track in-flight request 2020-01-15 10:40:16 +01:00
f_obex.c usb: gadget: u_serial: make OBEX port not a console 2019-10-22 10:27:09 +03:00
f_phonet.c usb: gadget: f_phonet: Replace zero-length array with flexible-array member 2020-02-14 08:38:16 -08:00
f_printer.c
f_rndis.c usb: gadget: fix wrong endpoint desc 2019-12-10 14:56:10 +02:00
f_serial.c usb: gadget: u_serial: allow more console gadget ports 2019-10-22 10:27:12 +03:00
f_sourcesink.c
f_subset.c
f_tcm.c usb: gadget: f_tcm: Provide support to get alternate setting in tcm function 2019-10-22 10:37:29 +03:00
f_uac1_legacy.c usb: gadget: remove redundant assignment to variable status 2020-02-10 11:15:27 -08:00
f_uac1.c
f_uac2.c
f_uvc.c media: usb/gadget/f_uvc: set device_caps in struct video_device 2019-06-05 08:47:44 -04:00
f_uvc.h
g_zero.h
Makefile
ndis.h
rndis.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
rndis.h
storage_common.c
storage_common.h Revert "usb: gadget: storage: Remove warning message" 2019-07-04 13:05:59 +02:00
tcm.h
u_audio.c usb: gadget: f_uac2: fix packet size calculation 2020-01-15 10:39:23 +01:00
u_audio.h
u_ecm.h usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
u_eem.h usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
u_ether_configfs.h usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
u_ether.c usb: Replace snprintf with scnprintf in gether_get_ifname 2019-06-20 08:53:11 +03:00
u_ether.h
u_fs.h usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
u_gether.h usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
u_hid.h usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
u_midi.h usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
u_ncm.h usb: gadget: f_ncm: Add OS descriptor support 2019-05-03 09:13:47 +03:00
u_phonet.h
u_printer.h usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
u_rndis.h usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
u_serial.c usb: gadget: u_serial: use mutex for serialising open()s 2019-10-22 10:27:20 +03:00
u_serial.h usb: gadget: u_serial: allow more console gadget ports 2019-10-22 10:27:12 +03:00
u_tcm.h
u_uac1_legacy.c
u_uac1_legacy.h
u_uac1.h
u_uac2.h usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
u_uvc.h usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
uvc_configfs.c usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
uvc_configfs.h usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
uvc_queue.c
uvc_queue.h
uvc_v4l2.c media: usb/gadget/f_uvc: set device_caps in struct video_device 2019-06-05 08:47:44 -04:00
uvc_v4l2.h usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
uvc_video.c
uvc_video.h usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
uvc.h