linux/drivers/dma
Gustavo A. R. Silva 1ee44529cc dmaengine: tegra210-adma: 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
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

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/20200214171657.GA25663@embeddedor
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-02-19 17:48:40 +05:30
..
bestcomm
dw
dw-axi-dmac
dw-edma
fsl-dpaa2-qdma
hsu
idxd dmaengine: idxd: remove set but not used variable 'idxd_cdev' 2020-02-13 20:03:41 +05:30
ioat
ipu
mediatek
ppc4xx
qcom
sf-pdma
sh
ti dmaengine: ti: dma-crossbar: convert to devm_platform_ioremap_resource() 2020-02-13 20:47:52 +05:30
xilinx
acpi-dma.c
altera-msgdma.c
amba-pl08x.c
at_hdmac.c
at_hdmac_regs.h
at_xdmac.c
bcm-sba-raid.c dmaengine: bcm-sba-raid: Replace zero-length array with flexible-array member 2020-02-13 20:15:35 +05:30
bcm2835-dma.c
coh901318.c
coh901318.h
coh901318_lli.c
dma-axi-dmac.c
dma-jz4780.c
dmaengine.c
dmaengine.h
dmatest.c
ep93xx_dma.c
fsl-edma-common.c
fsl-edma-common.h
fsl-edma.c
fsl-qdma.c
fsl_raid.c
fsl_raid.h
fsldma.c
fsldma.h
hisi_dma.c
idma64.c
idma64.h
img-mdc-dma.c
imx-dma.c
imx-sdma.c
iop-adma.c
iop-adma.h
k3dma.c
Kconfig
lpc18xx-dmamux.c
Makefile
mcf-edma.c
mic_x100_dma.c
mic_x100_dma.h
milbeaut-hdmac.c
milbeaut-xdmac.c
mmp_pdma.c
mmp_tdma.c
moxart-dma.c
mpc512x_dma.c
mv_xor.c
mv_xor.h
mv_xor_v2.c
mxs-dma.c
nbpfaxi.c
of-dma.c
owl-dma.c
pch_dma.c
pl330.c
plx_dma.c
pxa_dma.c
s3c24xx-dma.c
sa11x0-dma.c dmaengine: sa11x0: Replace zero-length array with flexible-array member 2020-02-19 17:48:40 +05:30
sirf-dma.c
sprd-dma.c dmaengine: sprd: Replace zero-length array with flexible-array member 2020-02-19 17:48:40 +05:30
st_fdma.c
st_fdma.h
ste_dma40.c
ste_dma40_ll.c
ste_dma40_ll.h
stm32-dma.c
stm32-dmamux.c
stm32-mdma.c
sun4i-dma.c dmaengine: sun4i: set the linear_mode properly 2020-02-17 12:21:08 +05:30
sun6i-dma.c
tegra20-apb-dma.c
tegra210-adma.c dmaengine: tegra210-adma: Replace zero-length array with flexible-array member 2020-02-19 17:48:40 +05:30
timb_dma.c
TODO
txx9dmac.c
txx9dmac.h
uniphier-mdmac.c dmaengine: uniphier-mdmac: replace zero-length array with flexible-array member 2020-02-13 20:15:57 +05:30
virt-dma.c
virt-dma.h
xgene-dma.c
zx_dma.c