Skip to content

Commit a611d13

Browse files
rapidio: Replace zero-length array with flexible-array
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] KSPP/linux#21 Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
1 parent 5342e9b commit a611d13

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/rapidio/rio-scan.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct rio_id_table {
3939
u16 start; /* logical minimal id */
4040
u32 max; /* max number of IDs in table */
4141
spinlock_t lock;
42-
unsigned long table[0];
42+
unsigned long table[];
4343
};
4444

4545
static int next_destid = 0;

0 commit comments

Comments
 (0)