Commit 1060bfc8 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva

drbd: 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] https://github.com/KSPP/linux/issues/21Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
parent 6c48764a
......@@ -620,7 +620,7 @@ struct fifo_buffer {
unsigned int head_index;
unsigned int size;
int total; /* sum of all values */
int values[0];
int values[];
};
extern struct fifo_buffer *fifo_alloc(unsigned int fifo_size);
......
......@@ -271,7 +271,7 @@ struct p_rs_param {
u32 resync_rate;
/* Since protocol version 88 and higher. */
char verify_alg[0];
char verify_alg[];
} __packed;
struct p_rs_param_89 {
......@@ -305,7 +305,7 @@ struct p_protocol {
u32 two_primaries;
/* Since protocol version 87 and higher. */
char integrity_alg[0];
char integrity_alg[];
} __packed;
......@@ -360,7 +360,7 @@ struct p_sizes {
u16 dds_flags; /* use enum dds_flags here. */
/* optional queue_limits if (agreed_features & DRBD_FF_WSAME) */
struct o_qlim qlim[0];
struct o_qlim qlim[];
} __packed;
struct p_state {
......@@ -409,7 +409,7 @@ struct p_compressed_bm {
*/
u8 encoding;
u8 code[0];
u8 code[];
} __packed;
struct p_delay_probe93 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment