From cf5a9d8c397f8394405c47e2909429eded4c78a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sun, 20 Feb 2022 04:16:21 +0100 Subject: [PATCH] zpool: main: use ARRAY_SIZE(class_name) instead of 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #13125 --- cmd/zpool/zpool_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index 43ab9c4cbb..280160678b 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -4688,7 +4688,7 @@ print_iostat_default(vdev_stat_t *vs, iostat_cbdata_t *cb, double scale) format, column_width, cb->cb_scripted); } -static const char *class_name[] = { +static const char *const class_name[] = { VDEV_ALLOC_BIAS_DEDUP, VDEV_ALLOC_BIAS_SPECIAL, VDEV_ALLOC_CLASS_LOGS @@ -4857,7 +4857,7 @@ children: /* * 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; 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' */ - for (uint_t n = 0; n < 3; n++) { + for (uint_t n = 0; n < ARRAY_SIZE(class_name); n++) { boolean_t printed = B_FALSE; for (c = 0; c < children; c++) {