Skip to content

Commit 8fcf4c4

Browse files
GustavoARSilvaaxboe
authored andcommitted
io_uring: 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.16/process/deprecated.html#zero-length-and-one-element-arrays Link: KSPP#78 Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent fbb8bb0 commit 8fcf4c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/uapi/linux/io_uring.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ struct io_uring_probe {
495495
__u8 ops_len; /* length of ops[] array below */
496496
__u16 resv;
497497
__u32 resv2[3];
498-
struct io_uring_probe_op ops[0];
498+
struct io_uring_probe_op ops[];
499499
};
500500

501501
struct io_uring_restriction {

0 commit comments

Comments
 (0)