@@ -1010,11 +1010,10 @@ static int iwl_mvm_ftm_range_resp_valid(struct iwl_mvm *mvm, u8 request_id,
static void iwl_mvm_ftm_rtt_smoothing(struct iwl_mvm *mvm,
struct cfg80211_pmsr_result *res)
{
- struct iwl_mvm_smooth_entry *resp;
+ struct iwl_mvm_smooth_entry *resp = NULL, *iter;
s64 rtt_avg, rtt = res->ftm.rtt_avg;
u32 undershoot, overshoot;
u8 alpha;
- bool found;
if (!IWL_MVM_FTM_INITIATOR_ENABLE_SMOOTH)
return;
@@ -1028,15 +1027,14 @@ static void iwl_mvm_ftm_rtt_smoothing(struct iwl_mvm *mvm,
return;
}
- found = false;
- list_for_each_entry(resp, &mvm->ftm_initiator.smooth.resp, list) {
- if (!memcmp(res->addr, resp->addr, ETH_ALEN)) {
- found = true;
+ list_for_each_entry(iter, &mvm->ftm_initiator.smooth.resp, list) {
+ if (!memcmp(res->addr, iter->addr, ETH_ALEN)) {
+ resp = iter;
break;
}
}
- if (!found) {
+ if (!resp) {
resp = kzalloc(sizeof(*resp), GFP_KERNEL);
if (!resp)
return;
@@ -376,12 +376,11 @@ static void iwl_mvm_te_handle_notif(struct iwl_mvm *mvm,
static int iwl_mvm_aux_roc_te_handle_notif(struct iwl_mvm *mvm,
struct iwl_time_event_notif *notif)
{
- struct iwl_mvm_time_event_data *te_data, *tmp;
- bool aux_roc_te = false;
+ struct iwl_mvm_time_event_data *aux_roc_te = NULL, *te_data;
- list_for_each_entry_safe(te_data, tmp, &mvm->aux_roc_te_list, list) {
+ list_for_each_entry(te_data, &mvm->aux_roc_te_list, list) {
if (le32_to_cpu(notif->unique_id) == te_data->uid) {
- aux_roc_te = true;
+ aux_roc_te = te_data;
break;
}
}