From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 01:10:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA28AEB3; Mon, 27 Oct 2014 01:10:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A65C6EA1; Mon, 27 Oct 2014 01:10:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9R1AfSY038667; Mon, 27 Oct 2014 01:10:41 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9R1AfHX038666; Mon, 27 Oct 2014 01:10:41 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201410270110.s9R1AfHX038666@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 27 Oct 2014 01:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273716 - head/sys/sparc64/sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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: Mon, 27 Oct 2014 01:10:41 -0000 Author: alc Date: Mon Oct 27 01:10:40 2014 New Revision: 273716 URL: https://svnweb.freebsd.org/changeset/base/273716 Log: Simplify memrw(). MFC after: 10 days Modified: head/sys/sparc64/sparc64/mem.c Modified: head/sys/sparc64/sparc64/mem.c ============================================================================== --- head/sys/sparc64/sparc64/mem.c Mon Oct 27 00:47:55 2014 (r273715) +++ head/sys/sparc64/sparc64/mem.c Mon Oct 27 01:10:40 2014 (r273716) @@ -65,13 +65,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include -#include #include #include @@ -92,7 +92,6 @@ memrw(struct cdev *dev, struct uio *uio, vm_size_t cnt; vm_page_t m; int error; - int i; uint32_t colors; cnt = 0; @@ -124,15 +123,7 @@ memrw(struct cdev *dev, struct uio *uio, cnt = ulmin(cnt, PAGE_SIZE - off); cnt = ulmin(cnt, iov->iov_len); - m = NULL; - for (i = 0; phys_avail[i] != 0; i += 2) { - if (pa >= phys_avail[i] && - pa < phys_avail[i + 1]) { - m = PHYS_TO_VM_PAGE(pa); - break; - } - } - + m = vm_phys_paddr_to_vm_page(pa); if (m != NULL) { if (ova == 0) { if (dcache_color_ignore == 0)