Skip to contentSkip to conversation

skd: use ARRAY_SIZE() to calculate size of an array.

PATCH New Muhammad Falak R Wani 1 participant 1 message May 11, 2016 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 skd: use ARRAY_SIZE() to calculate size of an array.

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

---
 drivers/block/skd_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/skd_main.c +1 -1
index 910e065..6bd8f29 100644
@@ -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];
 
Signature · 1 line
1.9.1