Skip to content

Commit 06190e1

Browse files
GustavoARSilvakees
authored andcommitted
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>
1 parent 9448598 commit 06190e1

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • drivers/gpu/drm/nouveau/nvif

drivers/gpu/drm/nouveau/nvif/fifo.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@ static int
2525
nvif_fifo_runlists(struct nvif_device *device)
2626
{
2727
struct nvif_object *object = &device->object;
28-
struct {
29-
struct nv_device_info_v1 m;
28+
TRAILING_OVERLAP(struct nv_device_info_v1, m, data,
3029
struct {
3130
struct nv_device_info_v1_data runlists;
3231
struct nv_device_info_v1_data runlist[64];
3332
} v;
34-
} *a;
33+
) *a;
3534
int ret, i;
3635

3736
if (device->runlist)

0 commit comments

Comments
 (0)