Skip to content

Commit 0b2e0c0

Browse files
KAGA-KOKOaxboe
authored andcommitted
skd: Use ARRAY_SIZE() where appropriate
Use ARRAY_SIZE() instead of open-coding it. This patch does not change any functionality. Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Hannes Reinecke <hare@suse.de> Cc: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 1cd3c1a commit 0b2e0c0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/block/skd_main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,7 +2160,7 @@ static enum skd_check_status_action
21602160
skd_check_status(struct skd_device *skdev,
21612161
u8 cmp_status, volatile struct fit_comp_error_info *skerr)
21622162
{
2163-
int i, n;
2163+
int i;
21642164

21652165
dev_err(&skdev->pdev->dev, "key/asc/ascq/fruc %02x/%02x/%02x/%02x\n",
21662166
skerr->key, skerr->code, skerr->qual, skerr->fruc);
@@ -2171,8 +2171,7 @@ skd_check_status(struct skd_device *skdev,
21712171
skerr->fruc);
21722172

21732173
/* Does the info match an entry in the good category? */
2174-
n = sizeof(skd_chkstat_table) / sizeof(skd_chkstat_table[0]);
2175-
for (i = 0; i < n; i++) {
2174+
for (i = 0; i < ARRAY_SIZE(skd_chkstat_table); i++) {
21762175
struct sns_info *sns = &skd_chkstat_table[i];
21772176

21782177
if (sns->mask & 0x10)

0 commit comments

Comments
 (0)