[PATCH 5/5] block-skd: Use ARRAY_SIZE() in skd_check_status()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 7 Aug 2017 14:34:33 +0200

The script "checkpatch.pl" pointed information out like the following.

WARNING: Prefer ARRAY_SIZE(skd_chkstat_table)

Thus use this macro.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
 drivers/block/skd_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c
index e53b40341834..555cf4810409 100644
--- a/drivers/block/skd_main.c
+++ b/drivers/block/skd_main.c
@@ -2272,7 +2272,7 @@ skd_check_status(struct skd_device *skdev,
 		 skerr->key, skerr->code, skerr->qual, skerr->fruc);
 
 	/* Does the info match an entry in the good category? */
-	n = sizeof(skd_chkstat_table) / sizeof(skd_chkstat_table[0]);
+	n = ARRAY_SIZE(skd_chkstat_table);
 	for (i = 0; i < n; i++) {
 		struct sns_info *sns = &skd_chkstat_table[i];
 
-- 
2.13.4

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux