wifi: mt76: Replace zero-length array with flexible-array member
authorGustavo A. R. Silva <gustavoars@kernel.org>
Thu, 6 Apr 2023 14:32:12 +0000 (08:32 -0600)
committerFelix Fietkau <nbd@nbd.name>
Mon, 17 Apr 2023 15:30:03 +0000 (17:30 +0200)
Zero-length arrays are deprecated [1] and have to be replaced by C99
flexible-array members.

This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines
on memcpy() and help to make progress towards globally enabling
-fstrict-flex-arrays=3 [2]

Link: https://github.com/KSPP/linux/issues/78
Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h

index 40a99e0..9dbfe26 100644 (file)
@@ -127,7 +127,7 @@ struct mt76_connac2_mcu_rxd {
        u8 rsv1[2];
        u8 s2d_index;
 
-       u8 tlv[0];
+       u8 tlv[];
 };
 
 struct mt76_connac2_patch_hdr {