Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Dec 2013 21:58:10 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r258856 - projects/altix2/sys/ia64/sgisn
Message-ID:  <201312022158.rB2LwAsZ011771@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Mon Dec  2 21:58:09 2013
New Revision: 258856
URL: http://svnweb.freebsd.org/changeset/base/258856

Log:
  Fix a "possibly used uninitialized" warning.

Modified:
  projects/altix2/sys/ia64/sgisn/sgisn_pcib.c

Modified: projects/altix2/sys/ia64/sgisn/sgisn_pcib.c
==============================================================================
--- projects/altix2/sys/ia64/sgisn/sgisn_pcib.c	Mon Dec  2 19:49:52 2013	(r258855)
+++ projects/altix2/sys/ia64/sgisn/sgisn_pcib.c	Mon Dec  2 21:58:09 2013	(r258856)
@@ -688,6 +688,7 @@ sgisn_pcib_iommu_map(device_t bus, devic
 
 	ate = 0;
 	entry = ~0;
+	bitshft = 0;
 	while (ate < (PCIB_REG_ATE_SIZE / 64) && entry == ~0) {
 		bits = sc->sc_ate[ate];
 		/* Move to the next long if this one is full. */
@@ -697,7 +698,6 @@ sgisn_pcib_iommu_map(device_t bus, devic
 		}
 		/* If this long is empty, take it (catches count == 64). */
 		if (bits == 0UL) {
-			bitshft = 0;
 			entry = ate * 64;
 			break;
 		}
@@ -706,7 +706,6 @@ sgisn_pcib_iommu_map(device_t bus, devic
 			ate++;
 			continue;
 		}
-		bitshft = 0;
 		do {
 			if ((bits & ((1UL << count) - 1UL)) == 0) {
 				entry = ate * 64 + bitshft;
@@ -721,8 +720,10 @@ sgisn_pcib_iommu_map(device_t bus, devic
 				bitshft++;
 			}
 		} while (bitshft <= (64 - count));
-		if (entry == ~0)
+		if (entry == ~0) {
 			ate++;
+			bitshft = 0;
+		}
 	}
 	if (entry != ~0) {
 		KASSERT(ate < (PCIB_REG_ATE_SIZE / 64), ("foo: ate"));



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