From b2dcbdf490252c9476a9e2b1871cf90c40325bca Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 8 Jul 2009 09:04:21 -0700 Subject: [PATCH] Resolve a 2 new cases of for loop variable declared in for() --- cmd/ztest/ztest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index d56cb03b5..bdb041677 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -1218,6 +1218,8 @@ online_vdev(vdev_t *vd, void *arg) vdev_t * vdev_walk_tree(vdev_t *vd, vdev_t *(*func)(vdev_t *, void *), void *arg) { + uint_t c; + if (vd->vdev_ops->vdev_op_leaf) { if (func == NULL) return (vd); @@ -1225,7 +1227,7 @@ vdev_walk_tree(vdev_t *vd, vdev_t *(*func)(vdev_t *, void *), void *arg) return (func(vd, arg)); } - for (uint_t c = 0; c < vd->vdev_children; c++) { + for (c = 0; c < vd->vdev_children; c++) { vdev_t *cvd = vd->vdev_child[c]; if ((cvd = vdev_walk_tree(cvd, func, arg)) != NULL) return (cvd); -- 2.40.0