summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavoars@kernel.org>2025-08-14 15:01:07 +0900
committerKees Cook <kees@kernel.org>2026-01-06 12:20:07 -0800
commit06190e1c86e4a0a30adf47ca20614c29b692dafc (patch)
tree6ff5890a7be79956bf5491a0c56073284ac53254 /drivers/gpu
parent9448598b22c50c8a5bb77a9103e2d49f134c9578 (diff)
drm/nouveau: fifo: Avoid -Wflex-array-member-not-at-end warning
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. Use the new TRAILING_OVERLAP() helper to fix the following warning: drivers/gpu/drm/nouveau/nvif/fifo.c:29:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] This helper creates a union between a flexible-array member (FAM) and a set of members that would otherwise follow it. This overlays the trailing members onto the FAM while preserving the original memory layout. Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Reviewed-by: Justin Stitt <justinstitt@google.com> Acked-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/aJ17oxJYcqqr3946@kspp Signed-off-by: Kees Cook <kees@kernel.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/nvif/fifo.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nvif/fifo.c b/drivers/gpu/drm/nouveau/nvif/fifo.c
index a463289962b2..b0ab80995d98 100644
--- a/drivers/gpu/drm/nouveau/nvif/fifo.c
+++ b/drivers/gpu/drm/nouveau/nvif/fifo.c
@@ -25,13 +25,12 @@ static int
nvif_fifo_runlists(struct nvif_device *device)
{
struct nvif_object *object = &device->object;
- struct {
- struct nv_device_info_v1 m;
+ TRAILING_OVERLAP(struct nv_device_info_v1, m, data,
struct {
struct nv_device_info_v1_data runlists;
struct nv_device_info_v1_data runlist[64];
} v;
- } *a;
+ ) *a;
int ret, i;
if (device->runlist)