Skip to contentSkip to conversation

rndis_wlan: make some variables unsigned

PATCH Superseded Dan Carpenter 2 participants 2 messages Feb 29, 2012 – Mar 1, 2012

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 3/4 rndis_wlan: make some variables unsigned

These variables can never be less than zero because we cap them in get_device_pmkids(). Let's make them unsigned here because it's simpler to not have to worry about negative numbers when we read the code.

drivers/net/wireless/rndis_wlan.c +4 -2
index a93cfe2..74e2d1b 100644
@@ -1790,7 +1790,8 @@ static struct ndis_80211_pmkid *remove_pmkid(struct usbnet *usbdev,
 						struct cfg80211_pmksa *pmksa,
 						int max_pmkids)
 {
-	int i, count, newlen, err;
+	int i, newlen, err;
+	unsigned int count;
 
 	count = le32_to_cpu(pmkids->bssid_info_count);
 
@@ -1830,7 +1831,8 @@ static struct ndis_80211_pmkid *update_pmkid(struct usbnet *usbdev,
 						struct cfg80211_pmksa *pmksa,
 						int max_pmkids)
 {
-	int i, err, count, newlen;
+	int i, err, newlen;
+	unsigned int count;
 
 	count = le32_to_cpu(pmkids->bssid_info_count);
 
Acked-by on v1 3/4
#1 lore raw

Quoting Dan Carpenter <[email protected]>:

Quoted 3 lines

These variables can never be less than zero because we cap them in get_device_pmkids(). Let's make them unsigned here because it's simpler to not have to worry about negative numbers when we read the code.

Quoted 32 lines
drivers/net/wireless/rndis_wlan.c +4 -2
index a93cfe2..74e2d1b 100644
@@ -1790,7 +1790,8 @@ static struct ndis_80211_pmkid  
 *remove_pmkid(struct usbnet *usbdev,
 						struct cfg80211_pmksa *pmksa,
 						int max_pmkids)
 {
-	int i, count, newlen, err;
+	int i, newlen, err;
+	unsigned int count;
 
 	count = le32_to_cpu(pmkids->bssid_info_count);
@@ -1830,7 +1831,8 @@ static struct ndis_80211_pmkid  
 *update_pmkid(struct usbnet *usbdev,
 						struct cfg80211_pmksa *pmksa,
 						int max_pmkids)
 {
-	int i, err, count, newlen;
+	int i, err, newlen;
+	unsigned int count;
 
 	count = le32_to_cpu(pmkids->bssid_info_count);