Skip to contentSkip to conversation

staging: wilc1000: Modification in code to use ARRAY_SIZE macro

PATCH New Dhere, Chaitanya (C.) 1 participant 1 message Jun 2, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: wilc1000: Modification in code to use ARRAY_SIZE macro

From: Chaitanya Dhere <[email protected]>

In this patch, ARRAY_SIZE() macro is used to determine the size. This change was detected with the help of coccinelle tool.

---
 drivers/staging/wilc1000/linux_wlan.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/linux_wlan.c +1 -1
index b033eb8..592b8ae 100644
@@ -1737,7 +1737,7 @@ static int linux_wlan_read_mac_addr(void *vp)
 	mm_segment_t old_fs;
 	loff_t pos = 0;
 	int index;
-	int array_size = sizeof(path_string) / sizeof(path_string[0]);
+	int array_size = ARRAY_SIZE(path_string);
 
 	/* change to KERNEL_DS address limit */
 	old_fs = get_fs();
Signature · 1 line
1.7.9.5