Skip to content

Commit b21de80

Browse files
mei: hw: Replace zero-length array with flexible-array member
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.9/process/deprecated.html#zero-length-and-one-element-arrays Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
1 parent 691f407 commit b21de80

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • drivers/misc/mei

drivers/misc/mei/hw.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ struct mei_ext_hdr {
224224
u8 type;
225225
u8 length;
226226
u8 ext_payload[2];
227-
u8 hdr[0];
227+
u8 hdr[];
228228
};
229229

230230
/**
@@ -238,7 +238,7 @@ struct mei_ext_meta_hdr {
238238
u8 count;
239239
u8 size;
240240
u8 reserved[2];
241-
struct mei_ext_hdr hdrs[0];
241+
struct mei_ext_hdr hdrs[];
242242
};
243243

244244
/*
@@ -308,7 +308,7 @@ struct mei_msg_hdr {
308308
u32 dma_ring:1;
309309
u32 internal:1;
310310
u32 msg_complete:1;
311-
u32 extension[0];
311+
u32 extension[];
312312
} __packed;
313313

314314
/* The length is up to 9 bits */

0 commit comments

Comments
 (0)