linux-stable/drivers/staging/greybus
Gustavo A. R. Silva 8acd7c56c1 staging: greybus: 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/20200211211219.GA673@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-11 14:04:53 -08:00
..
Documentation staging: greybus: remove license "boilerplate" 2019-08-27 19:02:26 +02:00
tools staging: greybus: remove license "boilerplate" 2019-08-27 19:02:26 +02:00
arche-apb-ctrl.c staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface 2019-01-15 16:18:14 +01:00
arche-platform.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
arche_platform.h staging: greybus: correct SPDX License Identifier 2018-11-09 09:49:02 -08:00
audio_apbridgea.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
audio_apbridgea.h staging: greybus: remove license "boilerplate" 2019-08-27 19:02:26 +02:00
audio_codec.c staging: remove unneeded static set .owner field in platform_driver 2018-09-14 10:45:51 +02:00
audio_codec.h staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
audio_gb.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
audio_manager.c staging: greybus: remove redundant assignment to variable is_empty 2019-07-22 07:34:10 +02:00
audio_manager.h staging: greybus: correct SPDX License Identifier 2018-11-09 09:49:02 -08:00
audio_manager_module.c staging: greybus: Parenthesis alignment 2018-11-26 20:59:05 +01:00
audio_manager_private.h staging: greybus: correct SPDX License Identifier 2018-11-09 09:49:02 -08:00
audio_manager_sysfs.c staging: greybus: Parenthesis alignment 2018-11-26 20:59:05 +01:00
audio_module.c staging: greybus: Parenthesis alignment 2018-11-26 20:59:05 +01:00
audio_topology.c Staging: greybus: Blank lines not required before '}' 2019-02-26 11:46:51 +01:00
authentication.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
bootrom.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
camera.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
firmware.h staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
fw-core.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
fw-download.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
fw-management.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
gb-camera.h staging: greybus: fix up SPDX comment in .h files 2019-08-27 19:02:18 +02:00
gbphy.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
gbphy.h staging: greybus: fix up SPDX comment in .h files 2019-08-27 19:02:18 +02:00
gpio.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
greybus_authentication.h staging: greybus: remove license "boilerplate" 2019-08-27 19:02:26 +02:00
greybus_firmware.h staging: greybus: remove license "boilerplate" 2019-08-27 19:02:26 +02:00
hid.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
i2c.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
Kconfig staging: greybus: move es2 to drivers/greybus/ 2019-08-27 19:03:08 +02:00
light.c staging: greybus: light: fix a couple double frees 2019-09-03 09:39:10 +02:00
log.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
loopback.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
Makefile staging: greybus: move es2 to drivers/greybus/ 2019-08-27 19:03:08 +02:00
power_supply.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
pwm.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
raw.c staging: greybus: Replace zero-length array with flexible-array member 2020-02-11 14:04:53 -08:00
sdio.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
spi.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
spilib.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
spilib.h staging: greybus: fix up SPDX comment in .h files 2019-08-27 19:02:18 +02:00
TODO staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP 2019-01-15 16:18:14 +01:00
uart.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
usb.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
vibrator.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00