ath10k: txrx: remove unreachable negative return check and fixup type
authorNicholas Mc Guire <hofrat@osadl.org>
Mon, 15 Jun 2015 11:46:43 +0000 (14:46 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 16 Jun 2015 10:14:54 +0000 (13:14 +0300)
wait_event_timeout(), introduced in 'commit 5e3dd157d7e7 ("ath10k: mac80211
driver for Qualcomm Atheros 802.11ac CQA98xx devices")' never returns < 0
so the only failure condition to be checked is == 0 (timeout). Further the
return type is long not int - an appropriately named variable is added
and the assignments fixed up.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/txrx.c

index 826500bb2b1b247233fbf1998733c2d8c16b3fe7..6cf289158840a3ba01da0f82c81a4e07916a4b70 100644 (file)
@@ -147,9 +147,9 @@ struct ath10k_peer *ath10k_peer_find_by_id(struct ath10k *ar, int peer_id)
 static int ath10k_wait_for_peer_common(struct ath10k *ar, int vdev_id,
                                       const u8 *addr, bool expect_mapped)
 {
-       int ret;
+       long time_left;
 
-       ret = wait_event_timeout(ar->peer_mapping_wq, ({
+       time_left = wait_event_timeout(ar->peer_mapping_wq, ({
                        bool mapped;
 
                        spin_lock_bh(&ar->data_lock);
@@ -160,7 +160,7 @@ static int ath10k_wait_for_peer_common(struct ath10k *ar, int vdev_id,
                         test_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags));
                }), 3*HZ);
 
-       if (ret <= 0)
+       if (time_left == 0)
                return -ETIMEDOUT;
 
        return 0;