iwlwifi: mvm: small cleanups in quota management code
Use a C99 initializer to clear the command and move the lockdep assertion before the restart check. Since this causes problems with the BUILD_BUG_ON() with some compilers, change that a bit. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
17dbe56445
commit
f5e45f2d96
1 changed files with 5 additions and 6 deletions
|
@ -131,7 +131,7 @@ static void iwl_mvm_quota_iterator(void *_data, u8 *mac,
|
||||||
|
|
||||||
int iwl_mvm_update_quotas(struct iwl_mvm *mvm, struct ieee80211_vif *newvif)
|
int iwl_mvm_update_quotas(struct iwl_mvm *mvm, struct ieee80211_vif *newvif)
|
||||||
{
|
{
|
||||||
struct iwl_time_quota_cmd cmd;
|
struct iwl_time_quota_cmd cmd = {};
|
||||||
int i, idx, ret, num_active_macs, quota, quota_rem;
|
int i, idx, ret, num_active_macs, quota, quota_rem;
|
||||||
struct iwl_mvm_quota_iterator_data data = {
|
struct iwl_mvm_quota_iterator_data data = {
|
||||||
.n_interfaces = {},
|
.n_interfaces = {},
|
||||||
|
@ -139,15 +139,14 @@ int iwl_mvm_update_quotas(struct iwl_mvm *mvm, struct ieee80211_vif *newvif)
|
||||||
.new_vif = newvif,
|
.new_vif = newvif,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
lockdep_assert_held(&mvm->mutex);
|
||||||
|
|
||||||
/* update all upon completion */
|
/* update all upon completion */
|
||||||
if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
|
if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
BUILD_BUG_ON(data.colors[MAX_BINDINGS - 1] != -1);
|
/* iterator data above must match */
|
||||||
|
BUILD_BUG_ON(MAX_BINDINGS != 4);
|
||||||
lockdep_assert_held(&mvm->mutex);
|
|
||||||
|
|
||||||
memset(&cmd, 0, sizeof(cmd));
|
|
||||||
|
|
||||||
ieee80211_iterate_active_interfaces_atomic(
|
ieee80211_iterate_active_interfaces_atomic(
|
||||||
mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
|
mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
|
||||||
|
|
Loading…
Add table
Reference in a new issue