Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: 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-rc1/process/deprecated.html#zero-length-and-one-element-arrays

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>

+2 -1
+2 -1
net/bluetooth/msft.c
··· 12 12 struct msft_cp_read_supported_features { 13 13 __u8 sub_opcode; 14 14 } __packed; 15 + 15 16 struct msft_rp_read_supported_features { 16 17 __u8 status; 17 18 __u8 sub_opcode; 18 19 __le64 features; 19 20 __u8 evt_prefix_len; 20 - __u8 evt_prefix[0]; 21 + __u8 evt_prefix[]; 21 22 } __packed; 22 23 23 24 struct msft_data {