ath10k: fixup wait_for_completion_timeout return handling
authorNicholas Mc Guire <der.herr@hofr.at>
Thu, 8 Jan 2015 12:27:34 +0000 (13:27 +0100)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 13 Jan 2015 14:19:59 +0000 (16:19 +0200)
wait_for_completion_timeout does not return negative values so the tests
for <= 0 are not needed and the case differentiation in the error handling
path unnecessary.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/debug.c
drivers/net/wireless/ath/ath10k/htc.c
drivers/net/wireless/ath/ath10k/htt.c
drivers/net/wireless/ath/ath10k/mac.c

index 6ca24427e18487b9e609d4a7f9209742183e7ebe..42b2e49b28366fd5940bd89e1bcfecd7f57236d1 100644 (file)
@@ -371,7 +371,7 @@ static int ath10k_debug_fw_stats_request(struct ath10k *ar)
 
                ret = wait_for_completion_timeout(&ar->debug.fw_stats_complete,
                                                  1*HZ);
-               if (ret <= 0)
+               if (ret == 0)
                        return -ETIMEDOUT;
 
                spin_lock_bh(&ar->data_lock);
index f1946a6be442cb1d031b91b0556df1b3ae275b32..2fd9e180272b3d48e642cb63e5fc7b09871bc998 100644 (file)
@@ -703,11 +703,9 @@ int ath10k_htc_connect_service(struct ath10k_htc *htc,
        /* wait for response */
        status = wait_for_completion_timeout(&htc->ctl_resp,
                                             ATH10K_HTC_CONN_SVC_TIMEOUT_HZ);
-       if (status <= 0) {
-               if (status == 0)
-                       status = -ETIMEDOUT;
+       if (status == 0) {
                ath10k_err(ar, "Service connect timeout: %d\n", status);
-               return status;
+               return -ETIMEDOUT;
        }
 
        /* we controlled the buffer creation, it's aligned */
index ceec76426070c8942d516a7f3d52f73939b1faae..4f59ab923e4849681287b0035a9ea20233e173a9 100644 (file)
@@ -101,7 +101,7 @@ int ath10k_htt_setup(struct ath10k_htt *htt)
 
        status = wait_for_completion_timeout(&htt->target_version_received,
                                             HTT_TARGET_VERSION_TIMEOUT_HZ);
-       if (status <= 0) {
+       if (status == 0) {
                ath10k_warn(ar, "htt version request timed out\n");
                return -ETIMEDOUT;
        }
index c7febfc9c68fc3f1098e4d52b5d44d6086e1c079..b403cba0afc1e3f06c2f390bd2a1b8a405d7d5b2 100644 (file)
@@ -2228,7 +2228,7 @@ void ath10k_offchan_tx_work(struct work_struct *work)
 
                ret = wait_for_completion_timeout(&ar->offchan_tx_completed,
                                                  3 * HZ);
-               if (ret <= 0)
+               if (ret == 0)
                        ath10k_warn(ar, "timed out waiting for offchannel skb %p\n",
                                    skb);