wifi: ipw2x00: fix array of flexible structures warnings
authorJohannes Berg <johannes.berg@intel.com>
Sun, 4 Sep 2022 19:29:02 +0000 (21:29 +0200)
committerKalle Valo <kvalo@kernel.org>
Thu, 22 Sep 2022 06:08:52 +0000 (09:08 +0300)
There are a number of these here, fix them by using
appropriate casts. 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.645346411660.I471e8fadce54ea262920828f25b8e84545bcd07e@changeid
drivers/net/wireless/intel/ipw2x00/libipw.h
drivers/net/wireless/intel/ipw2x00/libipw_rx.c

index 7964ef7d15f02010f0e18289d4a2b20d254fecaf..bec7bc27374885e639e0ca64dd445e68a28f08bd 100644 (file)
@@ -405,7 +405,7 @@ struct libipw_auth {
        __le16 transaction;
        __le16 status;
        /* challenge */
-       struct libipw_info_element info_element[];
+       u8 variable[];
 } __packed;
 
 struct libipw_channel_switch {
@@ -423,7 +423,6 @@ struct libipw_action {
        union {
                struct libipw_action_exchange {
                        u8 token;
-                       struct libipw_info_element info_element[0];
                } exchange;
                struct libipw_channel_switch channel_switch;
 
@@ -441,7 +440,7 @@ struct libipw_disassoc {
 struct libipw_probe_request {
        struct libipw_hdr_3addr header;
        /* SSID, supported rates */
-       struct libipw_info_element info_element[];
+       u8 variable[];
 } __packed;
 
 struct libipw_probe_response {
@@ -451,7 +450,7 @@ struct libipw_probe_response {
        __le16 capability;
        /* SSID, supported rates, FH params, DS params,
         * CF params, IBSS params, TIM (if beacon), RSN */
-       struct libipw_info_element info_element[];
+       u8 variable[];
 } __packed;
 
 /* Alias beacon for probe_response */
@@ -462,7 +461,7 @@ struct libipw_assoc_request {
        __le16 capability;
        __le16 listen_interval;
        /* SSID, supported rates, RSN */
-       struct libipw_info_element info_element[];
+       u8 variable[];
 } __packed;
 
 struct libipw_reassoc_request {
@@ -470,7 +469,7 @@ struct libipw_reassoc_request {
        __le16 capability;
        __le16 listen_interval;
        u8 current_ap[ETH_ALEN];
-       struct libipw_info_element info_element[];
+       u8 variable[];
 } __packed;
 
 struct libipw_assoc_response {
@@ -479,7 +478,7 @@ struct libipw_assoc_response {
        __le16 status;
        __le16 aid;
        /* supported rates */
-       struct libipw_info_element info_element[];
+       u8 variable[];
 } __packed;
 
 struct libipw_txb {
index 7a684b76f39b7d5f7e930823b4023147c38b2c87..48d6870bbf4e255444ca83d2c89d5b9a62726c3b 100644 (file)
@@ -1329,8 +1329,8 @@ static int libipw_handle_assoc_resp(struct libipw_device *ieee, struct libipw_as
        network->wpa_ie_len = 0;
        network->rsn_ie_len = 0;
 
-       if (libipw_parse_info_param
-           (frame->info_element, stats->len - sizeof(*frame), network))
+       if (libipw_parse_info_param((void *)frame->variable,
+                                   stats->len - sizeof(*frame), network))
                return 1;
 
        network->mode = 0;
@@ -1389,8 +1389,8 @@ static int libipw_network_init(struct libipw_device *ieee, struct libipw_probe_r
        network->wpa_ie_len = 0;
        network->rsn_ie_len = 0;
 
-       if (libipw_parse_info_param
-           (beacon->info_element, stats->len - sizeof(*beacon), network))
+       if (libipw_parse_info_param((void *)beacon->variable,
+                                   stats->len - sizeof(*beacon), network))
                return 1;
 
        network->mode = 0;
@@ -1510,7 +1510,7 @@ static void libipw_process_probe_response(struct libipw_device
        struct libipw_network *target;
        struct libipw_network *oldest = NULL;
 #ifdef CONFIG_LIBIPW_DEBUG
-       struct libipw_info_element *info_element = beacon->info_element;
+       struct libipw_info_element *info_element = (void *)beacon->variable;
 #endif
        unsigned long flags;