aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-06-01 17:38:23 -0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2015-06-03 02:43:20 -0400
commitebf17ff9bb46206ca7a4bc7260bff52f593c25db (patch)
treec674963add771a06aac0928f9c17221ea16f33f5 /drivers
parentaa42fb2420d4dc213d8306a9e0fdddf7ba83a10c (diff)
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')
-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 a7448cf01688..d24b6a83e68c 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,
797 797
798void iwl_mvm_stop_roc(struct iwl_mvm *mvm) 798void iwl_mvm_stop_roc(struct iwl_mvm *mvm)
799{ 799{
800 struct iwl_mvm_vif *mvmvif; 800 struct iwl_mvm_vif *mvmvif = NULL;
801 struct iwl_mvm_time_event_data *te_data; 801 struct iwl_mvm_time_event_data *te_data;
802 bool is_p2p = false; 802 bool is_p2p = false;
803 803
804 lockdep_assert_held(&mvm->mutex); 804 lockdep_assert_held(&mvm->mutex);
805 805
806 mvmvif = NULL;
807 spin_lock_bh(&mvm->time_event_lock); 806 spin_lock_bh(&mvm->time_event_lock);
808 807
809 /* 808 /*
@@ -821,17 +820,14 @@ void iwl_mvm_stop_roc(struct iwl_mvm *mvm)
821 } 820 }
822 } 821 }
823 822
824 /* 823 /* There can only be at most one AUX ROC time event, we just use the
825 * Iterate over the list of aux roc time events and find the time 824 * list to simplify/unify code. Remove it if it exists.
826 * event that is associated with a BSS interface.
827 * This assumes that a BSS interface can have only a single time
828 * event at any given time and this time event corresponds to a ROC
829 * request
830 */ 825 */
831 list_for_each_entry(te_data, &mvm->aux_roc_te_list, list) { 826 te_data = list_first_entry_or_null(&mvm->aux_roc_te_list,
827 struct iwl_mvm_time_event_data,
828 list);
829 if (te_data)
832 mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif); 830 mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif);
833 goto remove_te;
834 }
835 831
836remove_te: 832remove_te:
837 spin_unlock_bh(&mvm->time_event_lock); 833 spin_unlock_bh(&mvm->time_event_lock);