WSL2-Linux-Kernel/include/video
Gustavo A. R. Silva 451787d3e2 video: 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>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200221160005.GA13552@embeddedor
2020-03-02 16:32:17 +01:00
..
atmel_lcdc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
aty128.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
broadsheetfb.h broadsheetfb: support storing waveform 2010-03-12 15:52:34 -08:00
cirrus.h cirrusfb: Laguna chipset 8bpp fix 2009-04-01 08:59:27 -07:00
cvisionppc.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
da8xx-fb.h fbdev: da8xx: remove panel_power_ctrl() callback from platform data 2019-08-26 17:53:58 +05:30
display_timing.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 428 2019-06-05 17:37:16 +02:00
edid.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gbe.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 351 2019-06-05 17:37:08 +02:00
hecubafb.h fbdev: platforming hecubafb and n411 2008-04-28 08:58:41 -07:00
ili9320.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
imx-ipu-image-convert.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
imx-ipu-v3.h gpu: ipu-v3: ipu-ic: Fully describe colorspace conversions 2019-06-14 15:31:45 +02:00
kyro.h drivers/video/fbdev/kyrofb: Use arch_phys_wc_add() and pci_ioremap_wc_bar() 2015-08-25 09:59:44 +02:00
mach64.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
maxinefb.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mbxfb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
metronomefb.h [ARM] 5209/1: metronomefb: changes to use platform framebuffer 2008-08-26 17:01:12 +01:00
mipi_display.h drm/dsi: rename MIPI_DCS_SET_PARTIAL_AREA to MIPI_DCS_SET_PARTIAL_ROWS 2019-11-07 14:59:56 +02:00
mmp_disp.h video: Replace zero-length array with flexible-array member 2020-03-02 16:32:17 +01:00
neomagic.h video: fbdev: neofb: use arch_phys_wc_add() and ioremap_wc() 2015-06-03 12:41:49 +03:00
newport.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
of_display_timing.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 428 2019-06-05 17:37:16 +02:00
of_videomode.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 428 2019-06-05 17:37:16 +02:00
omap-panel-data.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
omapfb_dss.h video: fbdev: omap2: remove rfbi 2019-06-21 15:13:14 +02:00
omapvrfb.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333 2019-06-05 17:37:06 +02:00
permedia2.h pm2fb: hardware cursor support for the Permedia2 2007-10-16 09:43:18 -07:00
platform_lcd.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pm3fb.h pm3fb: header file cleanup 2007-10-16 09:43:18 -07:00
pmag-ba-fb.h [PATCH] DEC PMAG BA frame buffer update 2005-09-05 00:06:03 -07:00
pmagb-b-fb.h [PATCH] DEC PMAGB B framebuffer update 2005-09-05 00:06:03 -07:00
pxa168fb.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
radeon.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
s1d13xxxfb.h s1d13xxxfb: drop unused code 2010-12-21 01:05:43 +09:00
sa1100fb.h FB: sa1100: remove global sa1100fb_.*_power function pointers 2012-02-21 11:56:19 +00:00
samsung_fimd.h video: exynos: Rename Exynos to lowercase 2020-01-15 17:31:51 +01:00
sh_mobile_lcdc.h video: fbdev: sh_mobile_lcdcfb: remove unused MERAM support 2018-05-14 15:47:30 +02:00
sisfb.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 27 2019-05-24 17:27:10 +02:00
sstfb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tdfx.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tgafb.h tgafb: actually allocate memory for the pseudo_palette 2007-07-17 10:23:12 -07:00
trident.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
udlfb.h udlfb: introduce a rendering mutex 2019-04-01 17:46:57 +02:00
uvesafb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vga.h arch, drivers: don't include <asm/io.h> directly, use <linux/io.h> instead 2015-08-10 23:07:05 -04:00
videomode.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 428 2019-06-05 17:37:16 +02:00
w100fb.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00