iwlwifi: pcie: remove useless condition test
authorJohannes Berg <johannes.berg@intel.com>
Thu, 31 Oct 2013 17:30:38 +0000 (18:30 +0100)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Mon, 9 Dec 2013 20:29:01 +0000 (22:29 +0200)
After wait_event_timeout(), the condition must still be
true if it returns >0, in fact almost the last thing in
it is checking the condition again. It's therefore not
useful to check yet again in our code, clean it up.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/pcie/tx.c

index ff977b08341155bcf190ccc8da3a6f0c2279c5be..a4ef5cc1110010d76439a670242c8d9a22888094 100644 (file)
@@ -1542,30 +1542,24 @@ static int iwl_pcie_send_hcmd_sync(struct iwl_trans *trans,
        }
 
        if (!ret) {
-               if (test_bit(STATUS_HCMD_ACTIVE, &trans_pcie->status)) {
-                       struct iwl_txq *txq =
-                               &trans_pcie->txq[trans_pcie->cmd_queue];
-                       struct iwl_queue *q = &txq->q;
+               struct iwl_txq *txq = &trans_pcie->txq[trans_pcie->cmd_queue];
+               struct iwl_queue *q = &txq->q;
 
-                       IWL_ERR(trans,
-                               "Error sending %s: time out after %dms.\n",
-                               get_cmd_string(trans_pcie, cmd->id),
-                               jiffies_to_msecs(HOST_COMPLETE_TIMEOUT));
+               IWL_ERR(trans, "Error sending %s: time out after %dms.\n",
+                       get_cmd_string(trans_pcie, cmd->id),
+                       jiffies_to_msecs(HOST_COMPLETE_TIMEOUT));
 
-                       IWL_ERR(trans,
-                               "Current CMD queue read_ptr %d write_ptr %d\n",
-                               q->read_ptr, q->write_ptr);
+               IWL_ERR(trans, "Current CMD queue read_ptr %d write_ptr %d\n",
+                       q->read_ptr, q->write_ptr);
 
-                       clear_bit(STATUS_HCMD_ACTIVE, &trans_pcie->status);
-                       IWL_DEBUG_INFO(trans,
-                                      "Clearing HCMD_ACTIVE for command %s\n",
-                                      get_cmd_string(trans_pcie, cmd->id));
-                       ret = -ETIMEDOUT;
+               clear_bit(STATUS_HCMD_ACTIVE, &trans_pcie->status);
+               IWL_DEBUG_INFO(trans, "Clearing HCMD_ACTIVE for command %s\n",
+                              get_cmd_string(trans_pcie, cmd->id));
+               ret = -ETIMEDOUT;
 
-                       iwl_nic_error(trans);
+               iwl_nic_error(trans);
 
-                       goto cancel;
-               }
+               goto cancel;
        }
 
        if (test_bit(STATUS_FW_ERROR, &trans_pcie->status)) {