Bluetooth: use flexible-array member instead of zero-length array
authorQiheng Lin <linqiheng@huawei.com>
Sat, 10 Apr 2021 02:19:35 +0000 (10:19 +0800)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 26 Jun 2021 05:12:23 +0000 (07:12 +0200)
Fix the following coccicheck warning:

net/bluetooth/msft.c:37:6-13: WARNING use flexible-array member instead
net/bluetooth/msft.c:42:6-10: WARNING use flexible-array member instead
net/bluetooth/msft.c:52:6-10: WARNING use flexible-array member instead

Signed-off-by: Qiheng Lin <linqiheng@huawei.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/msft.c

index e28f15439ce4e5d89f03764b65a95b43e9bf98d1..37a394786a946c9f8a58f9f10824de99086e87b5 100644 (file)
@@ -34,12 +34,12 @@ struct msft_le_monitor_advertisement_pattern {
        __u8 length;
        __u8 data_type;
        __u8 start_byte;
-       __u8 pattern[0];
+       __u8 pattern[];
 };
 
 struct msft_le_monitor_advertisement_pattern_data {
        __u8 count;
-       __u8 data[0];
+       __u8 data[];
 };
 
 struct msft_cp_le_monitor_advertisement {
@@ -49,7 +49,7 @@ struct msft_cp_le_monitor_advertisement {
        __u8 rssi_low_interval;
        __u8 rssi_sampling_period;
        __u8 cond_type;
-       __u8 data[0];
+       __u8 data[];
 } __packed;
 
 struct msft_rp_le_monitor_advertisement {