summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-06-01 23:38:23 +0200
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2015-06-03 09:43:20 +0300
commitebf17ff9bb46206ca7a4bc7260bff52f593c25db (patch)
treec674963add771a06aac0928f9c17221ea16f33f5 /drivers/net/wireless/iwlwifi/mvm
parentaa42fb2420d4dc213d8306a9e0fdddf7ba83a10c (diff)
downloadop-kernel-dev-ebf17ff9bb46206ca7a4bc7260bff52f593c25db.zip
op-kernel-dev-ebf17ff9bb46206ca7a4bc7260bff52f593c25db.tar.gz
iwlwifi: mvm: simplify iwl_mvm_stop_roc()
As pointed out by smatch, there's no need for a loop that always immediately terminates. Use an if statement instead and while at it clean up the mvmvif initialization. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/time-event.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/time-event.c b/drivers/net/wireless/iwlwifi/mvm/time-event.c
index a7448cf..d24b6a8 100644
--- a/drivers/net/wireless/iwlwifi/mvm/time-event.c
+++ b/drivers/net/wireless/iwlwifi/mvm/time-event.c
@@ -797,13 +797,12 @@ int iwl_mvm_start_p2p_roc(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
void iwl_mvm_stop_roc(struct iwl_mvm *mvm)
{
- struct iwl_mvm_vif *mvmvif;
+ struct iwl_mvm_vif *mvmvif = NULL;
struct iwl_mvm_time_event_data *te_data;
bool is_p2p = false;
lockdep_assert_held(&mvm->mutex);
- mvmvif = NULL;
spin_lock_bh(&mvm->time_event_lock);
/*
@@ -821,17 +820,14 @@ void iwl_mvm_stop_roc(struct iwl_mvm *mvm)
}
}
- /*
- * Iterate over the list of aux roc time events and find the time
- * event that is associated with a BSS interface.
- * This assumes that a BSS interface can have only a single time
- * event at any given time and this time event corresponds to a ROC
- * request
+ /* There can only be at most one AUX ROC time event, we just use the
+ * list to simplify/unify code. Remove it if it exists.
*/
- list_for_each_entry(te_data, &mvm->aux_roc_te_list, list) {
+ te_data = list_first_entry_or_null(&mvm->aux_roc_te_list,
+ struct iwl_mvm_time_event_data,
+ list);
+ if (te_data)
mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif);
- goto remove_te;
- }
remove_te:
spin_unlock_bh(&mvm->time_event_lock);
OpenPOWER on IntegriCloud