Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/usermode/usermode Code audit revealed missing brack...



details:   https://anonhg.NetBSD.org/src/rev/f67b4ccd7417
branches:  trunk
changeset: 769572:f67b4ccd7417
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Wed Sep 14 19:45:27 2011 +0000

description:
Code audit revealed missing brackets and a silly old constant of 1024
lingering around. Fixed with the right values.

diffstat:

 sys/arch/usermode/usermode/pmap.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r c8df158c560c -r f67b4ccd7417 sys/arch/usermode/usermode/pmap.c
--- a/sys/arch/usermode/usermode/pmap.c Wed Sep 14 18:30:13 2011 +0000
+++ b/sys/arch/usermode/usermode/pmap.c Wed Sep 14 19:45:27 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.61 2011/09/14 18:28:36 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.62 2011/09/14 19:45:27 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk <reinoud%NetBSD.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.61 2011/09/14 18:28:36 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.62 2011/09/14 19:45:27 reinoud Exp $");
 
 #include "opt_memsize.h"
 #include "opt_kmempages.h"
@@ -769,7 +769,7 @@
         * to the header.  Otherwise we must search the list for
         * the entry.  In either case we free the now unused entry.
         */
-       if (pmap == pv->pv_pmap && lpn == pv->pv_lpn) {
+       if ((pmap == pv->pv_pmap) && (lpn == pv->pv_lpn)) {
                npv = pv->pv_next;
                if (npv) {
                        /* Pull up first entry from chain. */
@@ -973,7 +973,7 @@
 
        active_pmap = NULL;
        pmap->pm_flags &=~ PM_ACTIVE;
-       for (i = 0; i < 1024; i++) {
+       for (i = 0; i < pm_nentries; i++) {
                if (pmap->pm_entries[i] != NULL) {
                        pmap_page_deactivate(pmap->pm_entries[i]);
 //                     MEMC_WRITE(pmap->pm_entries[i]->pv_deactivate);



Home | Main Index | Thread Index | Old Index