wifi: rndis_wlan: fix array of flexible structures warning
authorJohannes Berg <johannes.berg@intel.com>
Sun, 4 Sep 2022 19:29:04 +0000 (21:29 +0200)
committerKalle Valo <kvalo@kernel.org>
Thu, 22 Sep 2022 06:08:53 +0000 (09:08 +0300)
Use "u8 bssid_data[]" with an appropriate cast. No binary
changes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220904212910.0e7ce5fdbcfb.I972158734def3f93b93a3858a087cbc2cca6337e@changeid
drivers/net/wireless/rndis_wlan.c

index 325933217b41bd219987cec137f69a2f1e34ca18..82a7458e01aec063643ec83da31cb3a50ae96cd4 100644 (file)
@@ -251,7 +251,7 @@ struct ndis_80211_bssid_ex {
 
 struct ndis_80211_bssid_list_ex {
        __le32 num_items;
-       struct ndis_80211_bssid_ex bssid[];
+       u8 bssid_data[];
 } __packed;
 
 struct ndis_80211_fixed_ies {
@@ -2084,7 +2084,8 @@ resize_buf:
        netdev_dbg(usbdev->net, "%s(): buflen: %d\n", __func__, len);
 
        bssid_len = 0;
-       bssid = next_bssid_list_item(bssid_list->bssid, &bssid_len, buf, len);
+       bssid = next_bssid_list_item((void *)bssid_list->bssid_data,
+                                    &bssid_len, buf, len);
 
        /* Device returns incorrect 'num_items'. Workaround by ignoring the
         * received 'num_items' and walking through full bssid buffer instead.