Subject: [PATCH 4/6] rt2x00 - txpower limits

From: Ivo van Doorn <[email-masked]>
Date: Tue, 8 Aug 2006 15:46:56 +0200

Also check for equality with txpower limits.
It doesn't do any harm, but it does prevent compiler
warnings in certain conditions.

Signed-off-by Ivo van Doorn <[email-masked]>

---

diff -rU3 wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2400pci.h wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2400pci.h
--- wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2400pci.h	2006-08-01 19:30:38.000000000 +0200
+++ wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2400pci.h	2006-08-08 15:05:04.000000000 +0200
@@ -881,8 +881,8 @@
 #define TXPOWER_TO_DEV(__txpower) \
 	({ \
 		(__txpower) += MIN_TXPOWER; \
-		((__txpower) < MIN_TXPOWER) ? MAX_TXPOWER : \
-		(((__txpower) > MAX_TXPOWER) ? MIN_TXPOWER : \
+		((__txpower) <= MIN_TXPOWER) ? MAX_TXPOWER : \
+		(((__txpower) >= MAX_TXPOWER) ? MIN_TXPOWER : \
 		(MAX_TXPOWER - ((__txpower) - MIN_TXPOWER))); \
 	})
 
diff -rU3 wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2500pci.h wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2500pci.h
--- wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2500pci.h	2006-08-01 19:30:38.000000000 +0200
+++ wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2500pci.h	2006-08-08 15:05:16.000000000 +0200
@@ -1142,8 +1142,8 @@
 
 #define TXPOWER_TO_DEV(__txpower) \
 	({ \
-		((__txpower) < MIN_TXPOWER) ? MIN_TXPOWER : \
-		(((__txpower) > MAX_TXPOWER) ? MAX_TXPOWER : \
+		((__txpower) <= MIN_TXPOWER) ? MIN_TXPOWER : \
+		(((__txpower) >= MAX_TXPOWER) ? MAX_TXPOWER : \
 		(__txpower)); \
 	})
 
diff -rU3 wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2500usb.h wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2500usb.h
--- wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt2500usb.h	2006-08-01 19:30:38.000000000 +0200
+++ wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt2500usb.h	2006-08-08 15:05:27.000000000 +0200
@@ -679,8 +679,8 @@
 
 #define TXPOWER_TO_DEV(__txpower) \
 	({ \
-		((__txpower) < MIN_TXPOWER) ? MIN_TXPOWER : \
-		(((__txpower) > MAX_TXPOWER) ? MAX_TXPOWER : \
+		((__txpower) <= MIN_TXPOWER) ? MIN_TXPOWER : \
+		(((__txpower) >= MAX_TXPOWER) ? MAX_TXPOWER : \
 		(__txpower)); \
 	})
 
diff -rU3 wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt61pci.h wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt61pci.h
--- wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt61pci.h	2006-08-01 19:30:38.000000000 +0200
+++ wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt61pci.h	2006-08-08 15:05:36.000000000 +0200
@@ -1360,8 +1360,8 @@
 
 #define TXPOWER_TO_DEV(__txpower) \
 	({ \
-		((__txpower) < MIN_TXPOWER) ? MIN_TXPOWER : \
-		(((__txpower) > MAX_TXPOWER) ? MAX_TXPOWER : \
+		((__txpower) <= MIN_TXPOWER) ? MIN_TXPOWER : \
+		(((__txpower) >= MAX_TXPOWER) ? MAX_TXPOWER : \
 		(__txpower)); \
 	})
 
diff -rU3 wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt73usb.h wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt73usb.h
--- wireless-dev-rt2x00-perm-addr/drivers/net/wireless/d80211/rt2x00/rt73usb.h	2006-08-01 19:30:38.000000000 +0200
+++ wireless-dev-rt2x00-txpower/drivers/net/wireless/d80211/rt2x00/rt73usb.h	2006-08-08 15:05:44.000000000 +0200
@@ -939,8 +939,8 @@
 
 #define TXPOWER_TO_DEV(__txpower) \
 	({ \
-		((__txpower) < MIN_TXPOWER) ? MIN_TXPOWER : \
-		(((__txpower) > MAX_TXPOWER) ? MAX_TXPOWER : \
+		((__txpower) <= MIN_TXPOWER) ? MIN_TXPOWER : \
+		(((__txpower) >= MAX_TXPOWER) ? MAX_TXPOWER : \
 		(__txpower)); \
 	})