lkml.org 
[lkml]   [2017]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 5/5] block-skd: Use ARRAY_SIZE() in skd_check_status()
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
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@users.sourceforge.net>
---
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
\
 
 \ /
  Last update: 2017-08-07 15:06    [W:0.045 / U:4.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site