svn commit: r269438 - head/sys/vm

Alan Cox alc at FreeBSD.org
Sat Aug 2 17:58:20 UTC 2014


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) {


More information about the svn-src-head mailing list