linux_dsm_epyc7002/drivers/usb/gadget
Gustavo A. R. Silva eaea6efe1d 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>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
2020-03-15 12:10:58 +02:00
..
function usb: gadget: f_phonet: Replace zero-length array with flexible-array member 2020-03-15 12:10:58 +02:00
legacy usb: gadget: add raw-gadget interface 2020-03-15 11:34:48 +02:00
udc usb: gadget: amd5536udc: fix spelling mistake "reserverd" -> "reserved" 2020-03-15 12:08:07 +02:00
composite.c usb: gadget: composite: Inform controller driver of self-powered 2020-03-15 12:10:14 +02:00
config.c
configfs.c usb: gadget: configfs: Add max_speed setting 2020-01-15 10:39:21 +01:00
configfs.h
epautoconf.c
functions.c
Kconfig usb: gadget: move choice ... endchoice to legacy/Kconfig 2019-12-17 16:24:13 +01:00
Makefile Revert "usb:gadget Separated decoding functions from dwc3 driver." 2019-07-04 13:02:09 +02:00
u_f.c
u_f.h
u_os_desc.h
usbstring.c