The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Muhammad Falak R Wani <falakreyaz@gmail.com>
To: Jens Axboe <axboe@fb.com>
Cc: Jeff Moyer <jmoyer@redhat.com>, Ming Lin <ming.l@ssi.samsung.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] skd: use ARRAY_SIZE() to calculate size of an array.
Date: Wed, 11 May 2016 22:01:19 +0530	[thread overview]
Message-ID: <1462984320-11769-1-git-send-email-falakreyaz@gmail.com> (raw)

Use the macro ARRAY_SIZE() to calculate the size of an array, enhancing
readability and compactnes.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
---
 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 910e065..6bd8f29 100644
--- a/drivers/block/skd_main.c
+++ b/drivers/block/skd_main.c
@@ -2282,7 +2282,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];
 
-- 
1.9.1

                 reply	other threads:[~2016-05-11 16:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1462984320-11769-1-git-send-email-falakreyaz@gmail.com \
    --to=falakreyaz@gmail.com \
    --cc=axboe@fb.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.l@ssi.samsung.com \
    /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