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

w1: 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/21

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

+2 -2
+2 -2
drivers/w1/w1_netlink.h
··· 73 73 __u32 res; 74 74 } mst; 75 75 } id; 76 - __u8 data[0]; 76 + __u8 data[]; 77 77 }; 78 78 79 79 /** ··· 122 122 __u8 cmd; 123 123 __u8 res; 124 124 __u16 len; 125 - __u8 data[0]; 125 + __u8 data[]; 126 126 }; 127 127 128 128 #ifdef __KERNEL__