staging: wilc1000: Modification in code to use ARRAY_SIZE macro
authorChaitanya Dhere <cvijaydh@visteon.com>
Tue, 2 Jun 2015 09:58:50 +0000 (09:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jun 2015 19:41:51 +0000 (12:41 -0700)
In this patch, ARRAY_SIZE() macro is used to determine the
size. This change was detected with the help of coccinelle
tool.

Signed-off-by: Chaitanya Dhere <cvijaydh@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/linux_wlan.c

index b033eb879ca1c15d27b10b9c9f5ab932f0a73408..592b8aec40e90eda1c837d11183e421edfef61f9 100644 (file)
@@ -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();