Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Jul 2019 19:25:30 +0000 (UTC)
From:      Doug Moore <dougm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r349745 - head/sys/vm
Message-ID:  <201907041925.x64JPUFM023619@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dougm
Date: Thu Jul  4 19:25:30 2019
New Revision: 349745
URL: https://svnweb.freebsd.org/changeset/base/349745

Log:
  Move an assignment, drop a label, and change gotos to break statements
  in vm_map_unwire. The code generated on amd86 is unchanged.
  
  Approved by: markj (mentor)
  Differential Revision: https://reviews.freebsd.org/D20850

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Thu Jul  4 19:17:55 2019	(r349744)
+++ head/sys/vm/vm_map.c	Thu Jul  4 19:25:30 2019	(r349745)
@@ -2867,6 +2867,7 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offs
 	}
 	last_timestamp = map->timestamp;
 	entry = first_entry;
+	rv = KERN_SUCCESS;
 	while (entry->start < end) {
 		if (entry->eflags & MAP_ENTRY_IN_TRANSITION) {
 			/*
@@ -2902,7 +2903,7 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offs
 						}
 						end = saved_start;
 						rv = KERN_INVALID_ADDRESS;
-						goto done;
+						break;
 					}
 				}
 				if (entry == first_entry)
@@ -2933,7 +2934,7 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offs
 		    (entry->end < end && entry->next->start > entry->end)) {
 			end = entry->end;
 			rv = KERN_INVALID_ADDRESS;
-			goto done;
+			break;
 		}
 		/*
 		 * If system unwiring, require that the entry is system wired.
@@ -2942,12 +2943,10 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offs
 		    vm_map_entry_system_wired_count(entry) == 0) {
 			end = entry->end;
 			rv = KERN_INVALID_ARGUMENT;
-			goto done;
+			break;
 		}
 		entry = entry->next;
 	}
-	rv = KERN_SUCCESS;
-done:
 	need_wakeup = false;
 	if (first_entry == NULL &&
 	    !vm_map_lookup_entry(map, start, &first_entry)) {



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