zpool: main: use ARRAY_SIZE(class_name) instead of 3

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13125
This commit is contained in:
наб 2022-02-20 04:16:21 +01:00 committed by Brian Behlendorf
parent f4826a2d46
commit cf5a9d8c39
1 changed files with 3 additions and 3 deletions

View File

@ -4688,7 +4688,7 @@ print_iostat_default(vdev_stat_t *vs, iostat_cbdata_t *cb, double scale)
format, column_width, cb->cb_scripted); format, column_width, cb->cb_scripted);
} }
static const char *class_name[] = { static const char *const class_name[] = {
VDEV_ALLOC_BIAS_DEDUP, VDEV_ALLOC_BIAS_DEDUP,
VDEV_ALLOC_BIAS_SPECIAL, VDEV_ALLOC_BIAS_SPECIAL,
VDEV_ALLOC_CLASS_LOGS VDEV_ALLOC_CLASS_LOGS
@ -4857,7 +4857,7 @@ children:
/* /*
* print all other top-level devices * print all other top-level devices
*/ */
for (uint_t n = 0; n < 3; n++) { for (uint_t n = 0; n < ARRAY_SIZE(class_name); n++) {
boolean_t printed = B_FALSE; boolean_t printed = B_FALSE;
for (c = 0; c < children; c++) { for (c = 0; c < children; c++) {
@ -6220,7 +6220,7 @@ print_list_stats(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
} }
/* list the classes: 'logs', 'dedup', and 'special' */ /* list the classes: 'logs', 'dedup', and 'special' */
for (uint_t n = 0; n < 3; n++) { for (uint_t n = 0; n < ARRAY_SIZE(class_name); n++) {
boolean_t printed = B_FALSE; boolean_t printed = B_FALSE;
for (c = 0; c < children; c++) { for (c = 0; c < children; c++) {