iwlwifi: mvm: simplify some return conditions
authorSara Sharon <sara.sharon@intel.com>
Fri, 16 Nov 2018 09:18:26 +0000 (11:18 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Mon, 4 Feb 2019 10:27:18 +0000 (12:27 +0200)
Simplify some return conditions found by running a semantic patch
to detect unnecessary assignments to local variables.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/coex.c
drivers/net/wireless/intel/iwlwifi/mvm/scan.c
drivers/net/wireless/intel/iwlwifi/mvm/sta.c

index 730e37744dc0243e5040772743c6ef8119a097d7..3d2abbc5c76cf83ae6ee000ba8889b9af2e11698 100644 (file)
@@ -241,7 +241,6 @@ static int iwl_mvm_bt_coex_reduced_txp(struct iwl_mvm *mvm, u8 sta_id,
        struct iwl_bt_coex_reduced_txp_update_cmd cmd = {};
        struct iwl_mvm_sta *mvmsta;
        u32 value;
-       int ret;
 
        mvmsta = iwl_mvm_sta_from_staid_protected(mvm, sta_id);
        if (!mvmsta)
@@ -262,10 +261,8 @@ static int iwl_mvm_bt_coex_reduced_txp(struct iwl_mvm *mvm, u8 sta_id,
        cmd.reduced_txp = cpu_to_le32(value);
        mvmsta->bt_reduced_txpower = enable;
 
-       ret = iwl_mvm_send_cmd_pdu(mvm, BT_COEX_UPDATE_REDUCED_TXP, CMD_ASYNC,
-                                  sizeof(cmd), &cmd);
-
-       return ret;
+       return iwl_mvm_send_cmd_pdu(mvm, BT_COEX_UPDATE_REDUCED_TXP,
+                                   CMD_ASYNC, sizeof(cmd), &cmd);
 }
 
 struct iwl_bt_iterator_data {
index 86d598d5b68fd0bcb310b867e208848ab1237ef2..af8156ba808415df64521bcebac066fd11a95672 100644 (file)
@@ -1976,9 +1976,8 @@ static int iwl_mvm_scan_stop_wait(struct iwl_mvm *mvm, int type)
                return ret;
        }
 
-       ret = iwl_wait_notification(&mvm->notif_wait, &wait_scan_done, 1 * HZ);
-
-       return ret;
+       return iwl_wait_notification(&mvm->notif_wait, &wait_scan_done,
+                                    1 * HZ);
 }
 
 int iwl_mvm_scan_size(struct iwl_mvm *mvm)
index c5a01470a3bc487495041c9f4e28e9ab01e80933..a102a16a15f6be284234abf3e127541843d220e3 100644 (file)
@@ -314,7 +314,6 @@ static int iwl_mvm_invalidate_sta_queue(struct iwl_mvm *mvm, int queue,
        struct iwl_mvm_sta *mvmsta;
        u32 status;
        u8 sta_id;
-       int ret;
 
        if (WARN_ON(iwl_mvm_has_new_tx_api(mvm)))
                return -EINVAL;
@@ -349,11 +348,9 @@ static int iwl_mvm_invalidate_sta_queue(struct iwl_mvm *mvm, int queue,
 
        /* Notify FW of queue removal from the STA queues */
        status = ADD_STA_SUCCESS;
-       ret = iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA,
-                                         iwl_mvm_add_sta_cmd_size(mvm),
-                                         &cmd, &status);
-
-       return ret;
+       return iwl_mvm_send_cmd_pdu_status(mvm, ADD_STA,
+                                          iwl_mvm_add_sta_cmd_size(mvm),
+                                          &cmd, &status);
 }
 
 static int iwl_mvm_disable_txq(struct iwl_mvm *mvm, struct ieee80211_sta *sta,