mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-08-27 03:37:18 +00:00
wifi: iwlwifi: mvm: Avoid -Wflex-array-member-not-at-end warning
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of a flexible structure where the size of the flexible-array member is known at compile-time, and refactor the rest of the code, accordingly. So, with these changes, fix the following warning: drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:6430:41: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Acked-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/Z-SV8gb6MuZJmmhe@kspp Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
17328a5b6a
commit
7438843df8
@ -6426,17 +6426,10 @@ void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm,
|
|||||||
bool sync,
|
bool sync,
|
||||||
const void *data, u32 size)
|
const void *data, u32 size)
|
||||||
{
|
{
|
||||||
struct {
|
DEFINE_RAW_FLEX(struct iwl_rxq_sync_cmd, cmd, payload,
|
||||||
struct iwl_rxq_sync_cmd cmd;
|
sizeof(struct iwl_mvm_internal_rxq_notif));
|
||||||
struct iwl_mvm_internal_rxq_notif notif;
|
struct iwl_mvm_internal_rxq_notif *notif =
|
||||||
} __packed cmd = {
|
(struct iwl_mvm_internal_rxq_notif *)cmd->payload;
|
||||||
.cmd.rxq_mask = cpu_to_le32(BIT(mvm->trans->num_rx_queues) - 1),
|
|
||||||
.cmd.count =
|
|
||||||
cpu_to_le32(sizeof(struct iwl_mvm_internal_rxq_notif) +
|
|
||||||
size),
|
|
||||||
.notif.type = type,
|
|
||||||
.notif.sync = sync,
|
|
||||||
};
|
|
||||||
struct iwl_host_cmd hcmd = {
|
struct iwl_host_cmd hcmd = {
|
||||||
.id = WIDE_ID(DATA_PATH_GROUP, TRIGGER_RX_QUEUES_NOTIF_CMD),
|
.id = WIDE_ID(DATA_PATH_GROUP, TRIGGER_RX_QUEUES_NOTIF_CMD),
|
||||||
.data[0] = &cmd,
|
.data[0] = &cmd,
|
||||||
@ -6447,15 +6440,21 @@ void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm,
|
|||||||
};
|
};
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
cmd->rxq_mask = cpu_to_le32(BIT(mvm->trans->num_rx_queues) - 1);
|
||||||
|
cmd->count = cpu_to_le32(sizeof(struct iwl_mvm_internal_rxq_notif) +
|
||||||
|
size);
|
||||||
|
notif->type = type;
|
||||||
|
notif->sync = sync;
|
||||||
|
|
||||||
/* size must be a multiple of DWORD */
|
/* size must be a multiple of DWORD */
|
||||||
if (WARN_ON(cmd.cmd.count & cpu_to_le32(3)))
|
if (WARN_ON(cmd->count & cpu_to_le32(3)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!iwl_mvm_has_new_rx_api(mvm))
|
if (!iwl_mvm_has_new_rx_api(mvm))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (sync) {
|
if (sync) {
|
||||||
cmd.notif.cookie = mvm->queue_sync_cookie;
|
notif->cookie = mvm->queue_sync_cookie;
|
||||||
mvm->queue_sync_state = (1 << mvm->trans->num_rx_queues) - 1;
|
mvm->queue_sync_state = (1 << mvm->trans->num_rx_queues) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user