From: Chaehyun Lim Date: Fri, 2 Oct 2015 07:41:16 +0000 (+0900) Subject: staging: wilc1000: use ARRAY_SIZE macro X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5cc59d299f0690c5ce3b32cdf8e07ac535c2288a;p=linux-beck.git staging: wilc1000: use ARRAY_SIZE macro 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c index 8acf648ead93..599508beabf8 100644 --- a/drivers/staging/wilc1000/wilc_spi.c +++ b/drivers/staging/wilc1000/wilc_spi.c @@ -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; }