Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Aug 2014 17:58:20 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269438 - head/sys/vm
Message-ID:  <201408021758.s72HwKQ8091657@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Sat Aug  2 17:58:20 2014
New Revision: 269438
URL: http://svnweb.freebsd.org/changeset/base/269438

Log:
  Rewrite a loop in vm_map_wire() so that gcc doesn't think that the variable
  "rv" is uninitialized.
  
  Reported by:	bz

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Sat Aug  2 17:45:08 2014	(r269437)
+++ head/sys/vm/vm_map.c	Sat Aug  2 17:58:20 2014	(r269438)
@@ -2569,8 +2569,8 @@ vm_map_wire(vm_map_t map, vm_offset_t st
 			vm_map_busy(map);
 			vm_map_unlock(map);
 
-			for (faddr = saved_start; faddr < saved_end; faddr +=
-			    PAGE_SIZE) {
+			faddr = saved_start;
+			do {
 				/*
 				 * Simulate a fault to get the page and enter
 				 * it into the physical map.
@@ -2578,7 +2578,7 @@ vm_map_wire(vm_map_t map, vm_offset_t st
 				if ((rv = vm_fault(map, faddr, VM_PROT_NONE,
 				    VM_FAULT_CHANGE_WIRING)) != KERN_SUCCESS)
 					break;
-			}
+			} while ((faddr += PAGE_SIZE) < saved_end);
 			vm_map_lock(map);
 			vm_map_unbusy(map);
 			if (last_timestamp + 1 != map->timestamp) {



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