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(). NFCI.



details:   https://anonhg.NetBSD.org/src/rev/765ea3fe8e8f
branches:  trunk
changeset: 934964:765ea3fe8e8f
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Jun 21 07:14:15 2020 +0000

description:
Use howmany().  NFCI.

diffstat:

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

diffs (33 lines):

diff -r 62d2fdde648e -r 765ea3fe8e8f sys/arch/arm/arm32/pmap.c
--- a/sys/arch/arm/arm32/pmap.c Sun Jun 21 07:06:05 2020 +0000
+++ b/sys/arch/arm/arm32/pmap.c Sun Jun 21 07:14:15 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.414 2020/05/27 06:43:22 skrll Exp $ */
+/*     $NetBSD: pmap.c,v 1.415 2020/06/21 07:14:15 skrll Exp $ */
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -192,7 +192,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.414 2020/05/27 06:43:22 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.415 2020/06/21 07:14:15 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -6337,12 +6337,12 @@
         * for L2 descriptor tables and metadata allocation in
         * pmap_growkernel().
         */
-       size = ((virtual_end - pmap_curmaxkvaddr) + L1_S_OFFSET) / L1_S_SIZE;
+       size = howmany(virtual_end - pmap_curmaxkvaddr, L1_S_SIZE);
        pmap_alloc_specials(&virtual_avail,
            round_page(size * L2_TABLE_SIZE_REAL) / PAGE_SIZE,
            &pmap_kernel_l2ptp_kva, NULL);
 
-       size = (size + (L2_BUCKET_SIZE - 1)) / L2_BUCKET_SIZE;
+       size = howmany(size, L2_BUCKET_SIZE);
        pmap_alloc_specials(&virtual_avail,
            round_page(size * sizeof(struct l2_dtable)) / PAGE_SIZE,
            &pmap_kernel_l2dtable_kva, NULL);



Home | Main Index | Thread Index | Old Index