summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2016-04-19 21:40:48 +0000
committerkrw <krw@openbsd.org>2016-04-19 21:40:48 +0000
commit438129a55f58c4ce14c84d1b0b4d885fee97f32e (patch)
tree69d6eb2a34676fc168162848f64ef8702e135a56 /sys/dev/softraid.c
parentChange a variable name (chunk_no -> cid) to make a couple of code (diff)
downloadwireguard-openbsd-438129a55f58c4ce14c84d1b0b4d885fee97f32e.tar.xz
wireguard-openbsd-438129a55f58c4ce14c84d1b0b4d885fee97f32e.zip
Use variable 'cid' in for(;;) rather than 'i' with an assignment
'cid = i;' when break'ing. Makes code consistent with same search later. No functional change and shrinks later functional diff.
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r--sys/dev/softraid.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index 62a17ea4fac..ff335328265 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.369 2016/04/19 21:19:58 krw Exp $ */
+/* $OpenBSD: softraid.c,v 1.370 2016/04/19 21:40:48 krw Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -3014,15 +3014,13 @@ sr_hotspare_rebuild(struct sr_discipline *sd)
* Attempt to locate a hotspare and initiate rebuild.
*/
- for (i = 0; i < sd->sd_meta->ssdi.ssd_chunk_no; i++) {
- if (sd->sd_vol.sv_chunks[i]->src_meta.scm_status ==
+ for (cid = 0; cid < sd->sd_meta->ssdi.ssd_chunk_no; cid++) {
+ if (sd->sd_vol.sv_chunks[cid]->src_meta.scm_status ==
BIOC_SDOFFLINE) {
- cid = i;
- chunk = sd->sd_vol.sv_chunks[i];
+ chunk = sd->sd_vol.sv_chunks[cid];
break;
}
}
-
if (chunk == NULL) {
printf("%s: no offline chunk found on %s!\n",
DEVNAME(sc), sd->sd_meta->ssd_devname);