Skip to contentSkip to conversation

trivial: use ARRAY_SIZE

PATCH Applied Kulikov Vasiliy 1 participant 1 message Jun 28, 2010 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 13/16 trivial: use ARRAY_SIZE

Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).

---
 drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +1 -1
index fb78ed2..d6f55c2 100644
@@ -85,7 +85,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
 	}
 	/* Add the protocol name */
 	iwe.cmd = SIOCGIWNAME;
-	for(i=0; i<(sizeof(ieee80211_modes)/sizeof(ieee80211_modes[0])); i++) {
+	for(i=0; i<ARRAY_SIZE(ieee80211_modes); i++) {
 		if(network->mode&(1<<i)) {
 			sprintf(pname,ieee80211_modes[i].mode_string,ieee80211_modes[i].mode_size);
 			pname +=ieee80211_modes[i].mode_size;
Signature · 1 line
1.7.0.4