From: Felix Fietkau <nbd@openwrt.org>
Date: Sun, 9 Mar 2014 08:51:16 +0000 (+0100)
Subject: ath9k_hw: fix unreachable code in baseband hang detection code
X-Git-Tag: v3.14-rc8~3^2~21^2^2~2
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=105ff411c96c52c67261efbe245f0947d39ebce7;p=users%2Fjedix%2Flinux-maple.git

ath9k_hw: fix unreachable code in baseband hang detection code

The commit "ath9k: reduce baseband hang detection false positive rate"
added a delay in the loop checking the baseband state, however it was
unreachable due to previous 'continue' statements.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---

diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 303ce27964c1..9078a6c5a74e 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1548,6 +1548,7 @@ bool ath9k_hw_check_alive(struct ath_hw *ah)
 		if (reg != last_val)
 			return true;
 
+		udelay(1);
 		last_val = reg;
 		if ((reg & 0x7E7FFFEF) == 0x00702400)
 			continue;
@@ -1560,8 +1561,6 @@ bool ath9k_hw_check_alive(struct ath_hw *ah)
 		default:
 			return true;
 		}
-
-		udelay(1);
 	} while (count-- > 0);
 
 	return false;