]> granicus.if.org Git - zfs/commitdiff
Resolve a 2 new cases of for loop variable declared in for()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 8 Jul 2009 16:04:21 +0000 (09:04 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 8 Jul 2009 16:04:21 +0000 (09:04 -0700)
cmd/ztest/ztest.c

index d56cb03b51afe2f6bb1235c1501fe8df57dc0466..bdb0416773609c30d2c3a9d6dda54ffc9683de0f 100644 (file)
@@ -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);