wifi: mwifiex: fix array of flexible structures warnings
authorJohannes Berg <johannes.berg@intel.com>
Sun, 4 Sep 2022 19:29:07 +0000 (21:29 +0200)
committerKalle Valo <kvalo@kernel.org>
Thu, 22 Sep 2022 06:08:53 +0000 (09:08 +0300)
There are two, just change them to have a "u8 data[]" type
member, and add casts where needed. No binary changes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220904212910.2c885310ebee.If7177ea588b56c405eee6e6df595e9efccdfb99a@changeid
drivers/net/wireless/marvell/mwifiex/fw.h
drivers/net/wireless/marvell/mwifiex/sta_cmd.c

index 26a48d8f49be98f0efe75b522ec3fe7e5b55354b..b4f945a549f71ce7711601d166431cf75fe57994 100644 (file)
@@ -2104,7 +2104,7 @@ struct mwifiex_fw_mef_entry {
 struct host_cmd_ds_mef_cfg {
        __le32 criteria;
        __le16 num_entries;
-       struct mwifiex_fw_mef_entry mef_entry[];
+       u8 mef_entry_data[];
 } __packed;
 
 #define CONNECTION_TYPE_INFRA   0
@@ -2254,7 +2254,7 @@ struct coalesce_receive_filt_rule {
 struct host_cmd_ds_coalesce_cfg {
        __le16 action;
        __le16 num_of_rules;
-       struct coalesce_receive_filt_rule rule[];
+       u8 rule_data[];
 } __packed;
 
 struct host_cmd_ds_multi_chan_policy {
index 512b5bb9cf6f57021c2cf031116f88889ba5d539..e2800a831c8edd1646c82f3ee63f11a277588710 100644 (file)
@@ -1435,7 +1435,7 @@ mwifiex_cmd_mef_cfg(struct mwifiex_private *priv,
                mef_entry = (struct mwifiex_fw_mef_entry *)pos;
                mef_entry->mode = mef->mef_entry[i].mode;
                mef_entry->action = mef->mef_entry[i].action;
-               pos += sizeof(*mef_cfg->mef_entry);
+               pos += sizeof(*mef_entry);
 
                if (mwifiex_cmd_append_rpn_expression(priv,
                                                      &mef->mef_entry[i], &pos))
@@ -1631,7 +1631,7 @@ mwifiex_cmd_coalesce_cfg(struct mwifiex_private *priv,
 
        coalesce_cfg->action = cpu_to_le16(cmd_action);
        coalesce_cfg->num_of_rules = cpu_to_le16(cfg->num_of_rules);
-       rule = coalesce_cfg->rule;
+       rule = (void *)coalesce_cfg->rule_data;
 
        for (cnt = 0; cnt < cfg->num_of_rules; cnt++) {
                rule->header.type = cpu_to_le16(TLV_TYPE_COALESCE_RULE);