summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2010-09-29 14:46:57 +0000
committermckusick <mckusick@FreeBSD.org>2010-09-29 14:46:57 +0000
commitbca797c2859c3471ebe723be961f198941d9cbf2 (patch)
treef8847614ac6fcc07030a52e0c03a0b80ddc135e9
parent2f07ce984fb548c4dc84e7d0ec01939a6f8528fd (diff)
downloadFreeBSD-src-bca797c2859c3471ebe723be961f198941d9cbf2.zip
FreeBSD-src-bca797c2859c3471ebe723be961f198941d9cbf2.tar.gz
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>
-rw-r--r--sys/ufs/ffs/ffs_softdep.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 941f866..475367dd 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -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;
OpenPOWER on IntegriCloud