summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2008-12-30 20:51:07 +0000
committeralc <alc@FreeBSD.org>2008-12-30 20:51:07 +0000
commitc1be5ff444d635919b317fe155b895cb45c0f2d7 (patch)
tree81d80020b57b88d94fe8ec0e176bf1cd4ab34c1a
parent2f6e82c78d5ac2ced68539f96f166f460141cb3f (diff)
downloadFreeBSD-src-c1be5ff444d635919b317fe155b895cb45c0f2d7.zip
FreeBSD-src-c1be5ff444d635919b317fe155b895cb45c0f2d7.tar.gz
Style change to vm_map_lookup(): Eliminate a macro of dubious value.
-rw-r--r--sys/vm/vm_map.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index f9bc9be..bc78ec2 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -3122,17 +3122,14 @@ vm_map_lookup(vm_map_t *var_map, /* IN/OUT */
RetryLookup:;
vm_map_lock_read(map);
-#define RETURN(why) \
- { \
- vm_map_unlock_read(map); \
- return (why); \
- }
/*
* Lookup the faulting address.
*/
- if (!vm_map_lookup_entry(map, vaddr, out_entry))
- RETURN(KERN_INVALID_ADDRESS);
+ if (!vm_map_lookup_entry(map, vaddr, out_entry)) {
+ vm_map_unlock_read(map);
+ return (KERN_INVALID_ADDRESS);
+ }
entry = *out_entry;
@@ -3159,13 +3156,15 @@ RetryLookup:;
prot = entry->protection;
fault_type &= (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
if ((fault_type & prot) != fault_type) {
- RETURN(KERN_PROTECTION_FAILURE);
+ vm_map_unlock_read(map);
+ return (KERN_PROTECTION_FAILURE);
}
if ((entry->eflags & MAP_ENTRY_USER_WIRED) &&
(entry->eflags & MAP_ENTRY_COW) &&
(fault_type & VM_PROT_WRITE) &&
(fault_typea & VM_PROT_OVERRIDE_WRITE) == 0) {
- RETURN(KERN_PROTECTION_FAILURE);
+ vm_map_unlock_read(map);
+ return (KERN_PROTECTION_FAILURE);
}
/*
@@ -3235,8 +3234,6 @@ RetryLookup:;
*out_prot = prot;
return (KERN_SUCCESS);
-
-#undef RETURN
}
/*
OpenPOWER on IntegriCloud