Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/arm32 Use howmany()



details:   https://anonhg.NetBSD.org/src/rev/b57da84c5d15
branches:  trunk
changeset: 935445:b57da84c5d15
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Jul 03 06:26:41 2020 +0000

description:
Use howmany()

diffstat:

 sys/arch/arm/arm32/arm32_kvminit.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 9eeb4977670f -r b57da84c5d15 sys/arch/arm/arm32/arm32_kvminit.c
--- a/sys/arch/arm/arm32/arm32_kvminit.c        Fri Jul 03 06:25:23 2020 +0000
+++ b/sys/arch/arm/arm32/arm32_kvminit.c        Fri Jul 03 06:26:41 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arm32_kvminit.c,v 1.61 2020/07/03 06:22:48 skrll Exp $ */
+/*     $NetBSD: arm32_kvminit.c,v 1.62 2020/07/03 06:26:41 skrll Exp $ */
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -127,7 +127,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.61 2020/07/03 06:22:48 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.62 2020/07/03 06:26:41 skrll Exp $");
 
 #include <sys/param.h>
 
@@ -476,7 +476,7 @@
        kernel_size += 0x10000; /* slop */
        if (!mapallmem_p) {
                kernel_size += PAGE_SIZE
-                   * ((kernel_size + L2_S_SEGSIZE - 1) / L2_S_SEGSIZE);
+                   * howmany(kernel_size, L2_S_SEGSIZE);
        }
        kernel_size = round_page(kernel_size);
 
@@ -484,7 +484,7 @@
         * Now we know how many L2 pages it will take.
         */
        const size_t KERNEL_L2PT_KERNEL_NUM =
-           round_page(kernel_size + L2_S_SEGSIZE - 1) / L2_S_SEGSIZE;
+           howmany(kernel_size, L2_S_SEGSIZE);
 
        VPRINTF("%s: %zu L2 pages are needed to map %#zx kernel bytes\n",
            __func__, KERNEL_L2PT_KERNEL_NUM, kernel_size);



Home | Main Index | Thread Index | Old Index