Since local variable 'i' is used only in a KASSERT, declare and

initialize it only if INVARIANTS is defined to avoid a declared
but unused warning.

Suggested by: Brian Somers <brian@FreeBSD.org>
This commit is contained in:
mckusick 2010-09-29 14:46:57 +00:00
parent 2f07ce984f
commit bca797c285

View File

@ -2899,9 +2899,10 @@ complete_jseg(jseg)
struct worklist *wk;
struct jmvref *jmvref;
int waiting;
int i;
#ifdef INVARIANTS
int i = 0;
#endif
i = 0;
while ((wk = LIST_FIRST(&jseg->js_entries)) != NULL) {
WORKLIST_REMOVE(wk);
waiting = wk->wk_state & IOWAITING;