Skip to contentSkip to conversation

ath9k_hw: remove unnecessary parts of the AR9380 SREV check

PATCH In review Felix Fietkau 2 participants 3 messages Apr 8, 2011 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath9k_hw: remove unnecessary parts of the AR9380 SREV check

Older versions have not been sold and the driver does not explicitly check for them anyway, so we can simply ignore the macRev here. Reduces ath9k_hw size on mips by more than 2 KB.

---
 drivers/net/wireless/ath/ath9k/reg.h |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/reg.h +1 -3
index 693d543..2fbbe88 100644
@@ -858,9 +858,7 @@
 #define AR_SREV_9300(_ah) \
 	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9300))
 #define AR_SREV_9300_20_OR_LATER(_ah) \
-	(((_ah)->hw_version.macVersion > AR_SREV_VERSION_9300) || \
-	 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9300) && \
-	  ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9300_20)))
+	((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9300)
 
 #define AR_SREV_9485(_ah) \
 	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9485))
Signature · 1 line
1.7.3.2
#1 lore raw
Quoted 14 lines · Felix Fietkau

Older versions have not been sold and the driver does not explicitly check for them anyway, so we can simply ignore the macRev here. Reduces ath9k_hw size on mips by more than 2 KB.

---
 drivers/net/wireless/ath/ath9k/reg.h |    4 +---

 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/reg.h +0 -0
index 693d543..2fbbe88 100644

drivers/net/wireless/ath/ath9k/reg.h line 861

Quoted 7 lines
drivers/net/wireless/ath/ath9k/reg.h +1 -3
@@ -858,9 +858,7 @@
  #define AR_SREV_9300(_ah) \
        (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9300))
  #define AR_SREV_9300_20_OR_LATER(_ah) \
-       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9300) || \
-        (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9300) && \
-         ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9300_20)))
+       ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9300)

Shouldn't this entire check be removed and replaced with AR_SREV_9300 everywhere? (BTW, the definition of AR_SREV_9300 has superfluous parentheses around it.)

Quoted 11 lines
drivers/net/wireless/ath/ath9k/reg.h +0 -1
  #define AR_SREV_9485(_ah) \
        (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9485))
--

1.7.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Signature · 1 line
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
#2 lore raw
Quoted 23 lines · Gábor Stefanik
Quoted 14 lines · Felix Fietkau

Older versions have not been sold and the driver does not explicitly check for them anyway, so we can simply ignore the macRev here. Reduces ath9k_hw size on mips by more than 2 KB.

---

   drivers/net/wireless/ath/ath9k/reg.h |    4 +---
   1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h index 693d543..2fbbe88 100644
--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -858,9 +858,7 @@

Quoted 7 lines
   #define AR_SREV_9300(_ah) \
         (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9300))

#define AR_SREV_9300_20_OR_LATER(_ah) \
- (((_ah)->hw_version.macVersion> AR_SREV_VERSION_9300) || \
- (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9300)&& \
- ((_ah)->hw_version.macRev>= AR_SREV_REVISION_9300_20)))
+ ((_ah)->hw_version.macVersion>= AR_SREV_VERSION_9300)

Quoted 3 lines

Shouldn't this entire check be removed and replaced with AR_SREV_9300 everywhere? (BTW, the definition of AR_SREV_9300 has superfluous parentheses around it.)

Yes, I was planning on making a patch for that later, because the AR9300 SREV checks aren't the only ones that need cleaning, almost all of the other chip types are affected as well. I prefer to keep the change that affects the generated code separate from that.

- Felix