staging: wilc1000: use ARRAY_SIZE macro
authorChaehyun Lim <chaehyun.lim@gmail.com>
Fri, 2 Oct 2015 07:41:16 +0000 (16:41 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Oct 2015 10:05:53 +0000 (12:05 +0200)
This patch uses ARRAY_SIZE macro found by checkpatch.pl

WARNING: Prefer ARRAY_SIZE(wb)
drivers/staging/wilc1000/wilc_spi.c:400
drivers/staging/wilc1000/wilc_spi.c:402

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/wilc_spi.c

index 8acf648ead939ff6e02e8805f3827dd1e653e407..599508beabf8b45445f38e5b2d17e656289c6f69 100644 (file)
@@ -397,9 +397,9 @@ static int spi_cmd_complete(u8 cmd, u32 adr, u8 *b, u32 sz, u8 clockless)
        }
 #undef NUM_DUMMY_BYTES
 
-       if (len2 > (sizeof(wb) / sizeof(wb[0]))) {
+       if (len2 > ARRAY_SIZE(wb)) {
                PRINT_ER("[wilc spi]: spi buffer size too small (%d) (%zu)\n",
-                        len2, (sizeof(wb) / sizeof(wb[0])));
+                        len2, ARRAY_SIZE(wb));
                result = N_FAIL;
                return result;
        }