Skip to content

Commit 18bdc20

Browse files
RxRPC: 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#21 Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
1 parent a611d13 commit 18bdc20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/keys/rxrpc-type.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct rxkad_key {
2828
u8 primary_flag; /* T if key for primary cell for this user */
2929
u16 ticket_len; /* length of ticket[] */
3030
u8 session_key[8]; /* DES session key */
31-
u8 ticket[0]; /* the encrypted ticket */
31+
u8 ticket[]; /* the encrypted ticket */
3232
};
3333

3434
/*
@@ -100,7 +100,7 @@ struct rxrpc_key_data_v1 {
100100
u32 expiry; /* time_t */
101101
u32 kvno;
102102
u8 session_key[8];
103-
u8 ticket[0];
103+
u8 ticket[];
104104
};
105105

106106
/*

0 commit comments

Comments
 (0)