From owner-svn-src-all@FreeBSD.ORG Tue Dec 30 20:51:08 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 652DC106566C; Tue, 30 Dec 2008 20:51:08 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 528588FC29; Tue, 30 Dec 2008 20:51:08 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBUKp8rK004797; Tue, 30 Dec 2008 20:51:08 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBUKp7XI004796; Tue, 30 Dec 2008 20:51:07 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200812302051.mBUKp7XI004796@svn.freebsd.org> From: Alan Cox Date: Tue, 30 Dec 2008 20:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186616 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2008 20:51:08 -0000 Author: alc Date: Tue Dec 30 20:51:07 2008 New Revision: 186616 URL: http://svn.freebsd.org/changeset/base/186616 Log: Style change to vm_map_lookup(): Eliminate a macro of dubious value. Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Tue Dec 30 20:39:47 2008 (r186615) +++ head/sys/vm/vm_map.c Tue Dec 30 20:51:07 2008 (r186616) @@ -3122,17 +3122,14 @@ vm_map_lookup(vm_map_t *var_map, /* IN/ 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 } /*