From ed2adfd3a1bbefbe61e05b69504fbbcbe9cd7d89 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Tue, 19 Apr 2016 21:40:49 +0000 Subject: 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. --- sys/dev/softraid.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'sys/dev') 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 * Copyright (c) 2008 Chris Kuethe @@ -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); -- cgit v1.2.3