linux_dsm_epyc7002/drivers/gpu/drm/vmwgfx
Gustavo A. R. Silva 6b65675542 drm/vmwgfx: 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>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2020-03-16 10:42:01 +01:00
..
device_include drm/vmwgfx: Add surface dirty-tracking callbacks 2019-11-06 15:45:32 +01:00
Kconfig drm/vmwgfx: Implement an infrastructure for write-coherent resources 2019-11-06 13:04:54 +01:00
Makefile drm/vmwgfx: Implement an infrastructure for write-coherent resources 2019-11-06 13:04:54 +01:00
ttm_lock.c drm/vmwgfx: Kill unneeded legacy security features 2019-08-15 08:39:27 +02:00
ttm_lock.h drm/vmwgfx: drop use of drmP.h in header files 2019-08-15 08:40:04 +02:00
ttm_object.c drm/vmwgfx: Fix user space handle equal to zero 2019-05-21 10:23:09 +02:00
ttm_object.h drm/vmwgfx: drop use of drmP.h in header files 2019-08-15 08:40:04 +02:00
vmwgfx_binding.c drm/vmwgfx: Use preprocessor macro for FIFO allocation 2019-04-08 10:29:05 -07:00
vmwgfx_binding.h drm/vmwgfx: drop use of drmP.h in header files 2019-08-15 08:40:04 +02:00
vmwgfx_blit.c dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
vmwgfx_bo.c drm/vmwgfx: Use an RBtree instead of linked list for MOB resources 2019-11-06 13:30:27 +01:00
vmwgfx_cmdbuf_res.c drm/vmwgfx: prevent memory leak in vmw_cmdbuf_res_add 2020-01-15 11:46:59 +01:00
vmwgfx_cmdbuf.c drm/vmwgfx: Fix the refuse_dma mode when using guest-backed objects 2020-03-12 12:00:07 +01:00
vmwgfx_context.c drm/vmwgfx: Assign eviction priorities to resources 2019-08-15 08:40:05 +02:00
vmwgfx_cotable.c drm-misc-next for 5.4: 2019-08-21 16:44:41 +10:00
vmwgfx_drv.c drm/vmwgfx: Refuse DMA operation when SEV encryption is active 2020-03-12 12:00:07 +01:00
vmwgfx_drv.h drm/vmwgfx: Remove a few unused functions 2020-03-12 15:31:12 +01:00
vmwgfx_execbuf.c drm/vmwgfx: Replace deprecated PTR_RET 2020-01-15 11:46:58 +01:00
vmwgfx_fb.c drm: constify fb ops across all drivers 2019-12-05 10:57:42 +02:00
vmwgfx_fence.c drm-misc-next for 5.4: 2019-08-21 16:44:41 +10:00
vmwgfx_fence.h drm/vmwgfx: drop use of drmP.h in header files 2019-08-15 08:40:04 +02:00
vmwgfx_fifo.c drm/vmwgfx: Drop preempt_disable() in vmw_fifo_ping_host() 2020-03-12 15:29:38 +01:00
vmwgfx_gmr.c drm/vmwgfx: drop reminaing users of drmP.h 2019-08-15 08:40:04 +02:00
vmwgfx_gmrid_manager.c drm/vmwgfx: Return 0 when gmrid::get_node runs out of ID's 2019-03-20 07:53:29 +01:00
vmwgfx_ioctl.c drm/vmwgfx: Add a new define for vmwgfx user-space debugging 2019-04-08 10:29:04 -07:00
vmwgfx_irq.c drm/vmwgfx: drop reminaing users of drmP.h 2019-08-15 08:40:04 +02:00
vmwgfx_kms.c drm/vmwgfx: Remove a few unused functions 2020-03-12 15:31:12 +01:00
vmwgfx_kms.h drm/vmwgfx: drop use of drmP.h in header files 2019-08-15 08:40:04 +02:00
vmwgfx_ldu.c drm/vmwgfx: Convert to CRTC VBLANK callbacks 2020-02-13 13:10:10 +01:00
vmwgfx_marker.c
vmwgfx_mob.c drm/vmwgfx: drop reminaing users of drmP.h 2019-08-15 08:40:04 +02:00
vmwgfx_msg.c drm/vmwgfx: add ioctl for messaging from/to guest userspace to/from host 2020-01-15 11:54:16 +01:00
vmwgfx_msg.h drm/vmwgfx: Update the backdoor call with support for new instructions 2019-08-28 13:36:46 +02:00
vmwgfx_overlay.c drm/vmwgfx: Remove a few unused functions 2020-03-12 15:31:12 +01:00
vmwgfx_page_dirty.c drm/vmwgfx: Replace zero-length array with flexible-array member 2020-03-16 10:42:01 +01:00
vmwgfx_prime.c drm/vmwgfx: Delete mmaping functions 2019-11-25 22:36:14 +01:00
vmwgfx_reg.h
vmwgfx_resource_priv.h drm/vmwgfx: Implement an infrastructure for read-coherent resources 2019-11-06 13:30:27 +01:00
vmwgfx_resource.c drm/vmwgfx: Implement an infrastructure for read-coherent resources 2019-11-06 13:30:27 +01:00
vmwgfx_scrn.c drm/vmwgfx: Convert to CRTC VBLANK callbacks 2020-02-13 13:10:10 +01:00
vmwgfx_shader.c drm/vmwgfx: Assign eviction priorities to resources 2019-08-15 08:40:05 +02:00
vmwgfx_simple_resource.c drm/vmwgfx: Add a new define for vmwgfx user-space debugging 2019-04-08 10:29:04 -07:00
vmwgfx_so.c drm/vmwgfx: Use preprocessor macro for FIFO allocation 2019-04-08 10:29:05 -07:00
vmwgfx_so.h drm/vmwgfx: Be more restrictive when dirtying resources 2019-04-08 10:29:04 -07:00
vmwgfx_stdu.c drm/vmwgfx: Fix the refuse_dma mode when using guest-backed objects 2020-03-12 12:00:07 +01:00
vmwgfx_surface.c drm/vmwgfx: Replace zero-length array with flexible-array member 2020-03-16 10:42:01 +01:00
vmwgfx_ttm_buffer.c drm/ttm: nuke invalidate_caches callback 2020-01-16 16:35:07 +01:00
vmwgfx_ttm_glue.c drm/vmwgfx: Use VM_PFNMAP instead of VM_MIXEDMAP when possible 2020-01-15 14:34:49 +01:00
vmwgfx_va.c
vmwgfx_validation.c drm/vmwgfx: Implement an infrastructure for read-coherent resources 2019-11-06 13:30:27 +01:00
vmwgfx_validation.h drm/vmwgfx: Implement an infrastructure for write-coherent resources 2019-11-06 13:04:54 +01:00