linux/drivers/gpu/drm/gma500
Gustavo A. R. Silva 1895a4fc3f drm/gma500/intel_bios.h: 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: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200305105306.GA18788@embeddedor
2020-03-06 11:40:53 +01:00
..
accel_2d.c drm/gma500: fix null dereference of pointer fb before null check 2019-12-19 15:33:40 +01:00
backlight.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 335 2019-06-05 17:37:06 +02:00
blitter.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
blitter.h Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
cdv_device.c Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
cdv_device.h Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
cdv_intel_crt.c drm/gma500: drop drmp.h include from all .c files 2019-05-22 14:13:40 +02:00
cdv_intel_display.c drm/gma500: Convert to CRTC VBLANK callbacks 2020-02-13 13:08:13 +01:00
cdv_intel_dp.c drm/gma500: remove set but not used variable 'channel_eq' 2019-11-18 10:52:55 +01:00
cdv_intel_hdmi.c drm/gma500: drop drmp.h include from all .c files 2019-05-22 14:13:40 +02:00
cdv_intel_lvds.c Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
framebuffer.c drm/gma500: Remove struct psb_fbdev 2019-11-25 11:19:31 +01:00
framebuffer.h drm/gma500: Remove struct psb_fbdev 2019-11-25 11:19:31 +01:00
gem.c Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
gem.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
gma_device.c Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
gma_device.h Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
gma_display.c drm/gma500: Add page flip support on psb/cdv 2019-11-07 10:16:31 +01:00
gma_display.h drm/gma500: Add page flip support on psb/cdv 2019-11-07 10:16:31 +01:00
gtt.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
gtt.h Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
intel_bios.c Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
intel_bios.h drm/gma500/intel_bios.h: Replace zero-length array with flexible-array member 2020-03-06 11:40:53 +01:00
intel_gmbus.c drm/gma500: drop drmp.h include from all .c files 2019-05-22 14:13:40 +02:00
intel_i2c.c Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mdfld_device.c Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
mdfld_dsi_dpi.c drm/gma500: drop drmp.h include from all .c files 2019-05-22 14:13:40 +02:00
mdfld_dsi_dpi.h
mdfld_dsi_output.c drm: Spelling s/connet/connect/ 2019-10-24 17:59:45 +02:00
mdfld_dsi_output.h drm/gma500: drop drmp.h include from all .c files 2019-05-22 14:13:40 +02:00
mdfld_dsi_pkg_sender.c drm/gma500: drop drmp.h include from all .c files 2019-05-22 14:13:40 +02:00
mdfld_dsi_pkg_sender.h
mdfld_intel_display.c drm/gma500: globle no more! 2019-12-13 18:15:48 +01:00
mdfld_output.c
mdfld_output.h
mdfld_tmd_vid.c drm/gma500: drop drmP.h from header files 2019-05-22 14:13:33 +02:00
mdfld_tpo_vid.c gpu: drm: gma500: remove two more dead variable 2017-05-23 17:38:33 +02:00
mid_bios.c Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
mid_bios.h Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
mmu.c Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
mmu.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
oaktrail_crtc.c drm/gma500: fix memory disclosures due to uninitialized bytes 2019-10-22 10:59:36 +02:00
oaktrail_device.c Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
oaktrail_hdmi_i2c.c
oaktrail_hdmi.c drm/gma500: remove set but not used variable 'htotal' 2019-11-15 16:50:24 +01:00
oaktrail_lvds_i2c.c drm/gma500: drop drmp.h include from all .c files 2019-05-22 14:13:40 +02:00
oaktrail_lvds.c drm/gma500: add a missed gma_power_end in error path 2019-12-09 21:30:03 +01:00
oaktrail.h Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
opregion.c
opregion.h
power.c
power.h drm/gma500: drop drmP.h from header files 2019-05-22 14:13:33 +02:00
psb_device.c Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
psb_device.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 335 2019-06-05 17:37:06 +02:00
psb_drv.c Linux 5.6-rc2 2020-02-17 10:34:34 +01:00
psb_drv.h drm/gma500: Convert to CRTC VBLANK callbacks 2020-02-13 13:08:13 +01:00
psb_intel_display.c drm/gma500: Convert to CRTC VBLANK callbacks 2020-02-13 13:08:13 +01:00
psb_intel_drv.h drm/gma500: Add page flip support on psb/cdv 2019-11-07 10:16:31 +01:00
psb_intel_lvds.c Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
psb_intel_modes.c Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
psb_intel_reg.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 335 2019-06-05 17:37:06 +02:00
psb_intel_sdvo_regs.h
psb_intel_sdvo.c drm/gma500: drop drmp.h include from all .c files 2019-05-22 14:13:40 +02:00
psb_irq.c drm/gma500: Convert to CRTC VBLANK callbacks 2020-02-13 13:08:13 +01:00
psb_irq.h drm/gma500: Convert to CRTC VBLANK callbacks 2020-02-13 13:08:13 +01:00
psb_lid.c Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
psb_reg.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 335 2019-06-05 17:37:06 +02:00
tc35876x-dsi-lvds.c drm/gma500: Pass GPIO for Intel MID using descriptors 2019-12-14 00:26:10 +01:00
tc35876x-dsi-lvds.h