linux/drivers/usb/musb
Gustavo A. R. Silva 21a37aeda6 USB: musb: 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/20200211232519.GA23263@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 08:38:16 -08:00
..
am35x.c usb: musb: remove references to default_a of struct usb_otg 2018-05-22 12:03:25 +02:00
cppi_dma.c USB: add SPDX identifiers to all remaining files in drivers/usb/ 2017-11-04 11:48:02 +01:00
cppi_dma.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
da8xx.c usb: musb: remove an unused variable 2018-05-31 12:44:39 +02:00
davinci.c usb: musb: davinci: Convert to use GPIO descriptor 2020-01-15 14:47:00 +01:00
davinci.h USB: musb: Remove redundant license text 2017-11-07 15:45:01 +01:00
jz4740.c usb: musb: jz4740: Whitespace and indentation fixes 2020-01-15 14:46:57 +01:00
Kconfig usb: musb: remove dummy driver musb_am335x.c 2020-01-15 14:47:00 +01:00
Makefile usb: musb: remove dummy driver musb_am335x.c 2020-01-15 14:47:00 +01:00
mediatek.c usb: musb: Add support for MediaTek musb controller 2020-01-15 14:46:59 +01:00
musb_core.c usb: musb: fix spelling mistake: "periperal" -> "peripheral" 2020-01-21 19:58:45 +01:00
musb_core.h usb: musb: Add musb_clearb/w() interface 2020-01-15 14:46:59 +01:00
musb_cppi41.c usb: musb: remove duplicated quirks flag 2018-05-22 12:03:24 +02:00
musb_debug.h USB: musb: clean up debugfs file and directory creation 2018-05-31 12:54:21 +02:00
musb_debugfs.c usb: musb: create debugfs directory under usb root 2019-11-21 18:20:29 +01:00
musb_dma.h usb: musb: Add noirq type of dma create interface 2020-01-15 14:46:59 +01:00
musb_dsps.c usb: musb: dsps: create debugfs directory under usb root 2019-11-14 11:16:35 +08:00
musb_gadget_ep0.c usb: musb: gadget: misplaced out of bounds check 2018-03-29 18:37:28 +02:00
musb_gadget.c usb: Spelling s/enpoint/endpoint/ 2019-11-04 15:53:00 +01:00
musb_gadget.h usb: musb: gadget: fix to_musb_ep() to not return NULL 2018-05-22 12:03:25 +02:00
musb_host.c USB: musb: Replace zero-length array with flexible-array member 2020-02-14 08:38:16 -08:00
musb_host.h usb: musb: fix remote wakeup racing with suspend 2018-05-14 17:04:06 +02:00
musb_io.h usb: musb: Add musb_clearb/w() interface 2020-01-15 14:46:59 +01:00
musb_regs.h usb: musb: remove some register access wrapper functions 2018-05-22 12:03:24 +02:00
musb_trace.c USB: musb: Remove redundant license text 2017-11-07 15:45:01 +01:00
musb_trace.h USB: musb: fix __iomem in trace functions 2020-01-15 14:46:58 +01:00
musb_virthub.c usb: musb: remove duplicated port mode enum 2018-05-22 12:03:25 +02:00
musbhsdma.c usb: musb: Add musb_clearb/w() interface 2020-01-15 14:46:59 +01:00
omap2430.c usb: musb: Get rid of omap2430_musb_set_vbus() 2020-01-15 14:46:56 +01:00
omap2430.h USB: musb: Remove redundant license text 2017-11-07 15:45:01 +01:00
sunxi.c usb: musb: Add musb_clearb/w() interface 2020-01-15 14:46:59 +01:00
tusb6010_omap.c USB: musb: Remove redundant license text 2017-11-07 15:45:01 +01:00
tusb6010.c usb: musb: Add musb_clearb/w() interface 2020-01-15 14:46:59 +01:00
tusb6010.h USB: musb: Remove redundant license text 2017-11-07 15:45:01 +01:00
ux500_dma.c usb: musb/ux500: Use dma_request_chan() instead dma_request_slave_channel() 2020-01-15 14:46:58 +01:00
ux500.c usb: musb: remove references to default_a of struct usb_otg 2018-05-22 12:03:25 +02:00