Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Sep 2010 14:46:57 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r213275 - head/sys/ufs/ffs
Message-ID:  <201009291446.o8TEkvBV012977@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Wed Sep 29 14:46:57 2010
New Revision: 213275
URL: http://svn.freebsd.org/changeset/base/213275

Log:
  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>

Modified:
  head/sys/ufs/ffs/ffs_softdep.c

Modified: head/sys/ufs/ffs/ffs_softdep.c
==============================================================================
--- head/sys/ufs/ffs/ffs_softdep.c	Wed Sep 29 14:41:03 2010	(r213274)
+++ head/sys/ufs/ffs/ffs_softdep.c	Wed Sep 29 14:46:57 2010	(r213275)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009291446.o8TEkvBV012977>