Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amd64/amd64 Match the iterator in sys/uvm/uvm_page....



details:   https://anonhg.NetBSD.org/src/rev/fafbecbca3ff
branches:  trunk
changeset: 351178:fafbecbca3ff
user:      maya <maya%NetBSD.org@localhost>
date:      Sun Feb 05 06:12:33 2017 +0000

description:
Match the iterator in sys/uvm/uvm_page.c:1866. NFC.
No matching KASSERT - this case is covered by the above
if (uvm_physseg_valid_p(upm) == false) break;

diffstat:

 sys/arch/amd64/amd64/machdep.c |  14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diffs (40 lines):

diff -r 42a531eac381 -r fafbecbca3ff sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c    Sun Feb 05 04:05:05 2017 +0000
+++ b/sys/arch/amd64/amd64/machdep.c    Sun Feb 05 06:12:33 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.246 2016/12/26 17:54:06 cherry Exp $     */
+/*     $NetBSD: machdep.c,v 1.247 2017/02/05 06:12:33 maya Exp $       */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -111,7 +111,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.246 2016/12/26 17:54:06 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.247 2017/02/05 06:12:33 maya Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -806,17 +806,15 @@
                if (uvm_physseg_valid_p(upm) == false)
                        break;
 
-               const paddr_t startpfn = uvm_physseg_get_start(upm);
-               const paddr_t endpfn = uvm_physseg_get_end(upm);
-
-               KASSERT(startpfn != -1 && endpfn != -1);
-
                /*
                 * We assume that seg->start to seg->end are
                 * uvm_page_physload()ed
                 */
-               for (pfn = startpfn; pfn <= endpfn; pfn++) {
+               for (pfn = uvm_physseg_get_start(upm);
+                    pfn <= uvm_physseg_get_end(upm);
+                    pfn++) {
                        pg = PHYS_TO_VM_PAGE(ptoa(pfn));
+
                        if (pg->uanon || (pg->pqflags & PQ_FREE) ||
                            (pg->uobject && pg->uobject->pgops)) {
                                p = VM_PAGE_TO_PHYS(pg) / PAGE_SIZE;



Home | Main Index | Thread Index | Old Index