Skip to content

Commit 7206d58

Browse files
net/smc: 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 2905620 commit 7206d58

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

net/smc/smc_clc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ struct smc_clc_v2_extension {
124124
struct smc_clnt_opts_area_hdr hdr;
125125
u8 roce[16]; /* RoCEv2 GID */
126126
u8 reserved[16];
127-
u8 user_eids[0][SMC_MAX_EID_LEN];
127+
u8 user_eids[][SMC_MAX_EID_LEN];
128128
};
129129

130130
struct smc_clc_msg_proposal_prefix { /* prefix part of clc proposal message*/
@@ -143,7 +143,7 @@ struct smc_clc_msg_smcd { /* SMC-D GID information */
143143
struct smc_clc_smcd_v2_extension {
144144
u8 system_eid[SMC_MAX_EID_LEN];
145145
u8 reserved[16];
146-
struct smc_clc_smcd_gid_chid gidchid[0];
146+
struct smc_clc_smcd_gid_chid gidchid[];
147147
};
148148

149149
struct smc_clc_msg_proposal { /* clc proposal message sent by Linux */

0 commit comments

Comments
 (0)