linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Geliang Tang <geliangtang@gmail.com>,
	Jens Axboe <axboe@kernel.dk>,
	kernel-janitors@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 5/5] block-skd: Use ARRAY_SIZE() in skd_check_status()
Date: Mon, 7 Aug 2017 15:05:45 +0200	[thread overview]
Message-ID: <4b9886f6-105e-c981-88af-ce7dfcc97e7a@users.sourceforge.net> (raw)
In-Reply-To: <56b55301-2db3-9c0b-297f-c2115fd92c6c@users.sourceforge.net>

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

      parent reply	other threads:[~2017-08-07 13:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-07 12:55 [PATCH 0/5] block-skd: Adjustments for some function implementations SF Markus Elfring
2017-08-07 12:57 ` [PATCH 1/5] block-skd: Delete an error message for a failed memory allocation in three functions SF Markus Elfring
2017-08-07 13:00 ` [PATCH 2/5] block-skd: Adjust 44 checks for null pointers SF Markus Elfring
2017-08-07 13:02 ` [PATCH 3/5] block-skd: Delete an unnecessary return statement in skd_pci_remove() SF Markus Elfring
2017-08-07 13:03 ` [PATCH 4/5] block-skd: Fix a typo in a comment line in skd_do_inq_page_da() SF Markus Elfring
2017-08-07 13:05 ` SF Markus Elfring [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4b9886f6-105e-c981-88af-ce7dfcc97e7a@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --cc=geliangtang@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).