diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-07-25 16:36:27 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-08-06 04:33:47 -0400 |
commit | f5e45f2d960cea226b9d173e232c94c4c388c1bc (patch) | |
tree | ebc17997e60523cd803f8a657b0252ea2146b238 /drivers/net/wireless | |
parent | 17dbe56445328fcc275f2ca318c06e55d7d403df (diff) |
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>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/quota.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/quota.c b/drivers/net/wireless/iwlwifi/mvm/quota.c index 18973874b77a..5c6ae16ec52b 100644 --- a/drivers/net/wireless/iwlwifi/mvm/quota.c +++ b/drivers/net/wireless/iwlwifi/mvm/quota.c | |||
@@ -131,7 +131,7 @@ static void iwl_mvm_quota_iterator(void *_data, u8 *mac, | |||
131 | 131 | ||
132 | int iwl_mvm_update_quotas(struct iwl_mvm *mvm, struct ieee80211_vif *newvif) | 132 | int iwl_mvm_update_quotas(struct iwl_mvm *mvm, struct ieee80211_vif *newvif) |
133 | { | 133 | { |
134 | struct iwl_time_quota_cmd cmd; | 134 | struct iwl_time_quota_cmd cmd = {}; |
135 | int i, idx, ret, num_active_macs, quota, quota_rem; | 135 | int i, idx, ret, num_active_macs, quota, quota_rem; |
136 | struct iwl_mvm_quota_iterator_data data = { | 136 | struct iwl_mvm_quota_iterator_data data = { |
137 | .n_interfaces = {}, | 137 | .n_interfaces = {}, |
@@ -139,15 +139,14 @@ int iwl_mvm_update_quotas(struct iwl_mvm *mvm, struct ieee80211_vif *newvif) | |||
139 | .new_vif = newvif, | 139 | .new_vif = newvif, |
140 | }; | 140 | }; |
141 | 141 | ||
142 | lockdep_assert_held(&mvm->mutex); | ||
143 | |||
142 | /* update all upon completion */ | 144 | /* update all upon completion */ |
143 | if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) | 145 | if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) |
144 | return 0; | 146 | return 0; |
145 | 147 | ||
146 | BUILD_BUG_ON(data.colors[MAX_BINDINGS - 1] != -1); | 148 | /* iterator data above must match */ |
147 | 149 | BUILD_BUG_ON(MAX_BINDINGS != 4); | |
148 | lockdep_assert_held(&mvm->mutex); | ||
149 | |||
150 | memset(&cmd, 0, sizeof(cmd)); | ||
151 | 150 | ||
152 | ieee80211_iterate_active_interfaces_atomic( | 151 | ieee80211_iterate_active_interfaces_atomic( |
153 | mvm->hw, IEEE80211_IFACE_ITER_NORMAL, | 152 | mvm->hw, IEEE80211_IFACE_ITER_NORMAL, |