From 2a473e5a33c7e9694074a8c154bb60515fb9de81 Mon Sep 17 00:00:00 2001 From: pfg Date: Tue, 26 Apr 2016 14:44:49 +0000 Subject: sys/powerpc: make use of the howmany() macro when available. We have a howmany() macro in the header that is convenient to re-use as it makes things easier to read. --- sys/powerpc/booke/pmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/powerpc/booke') diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c index cd71526..429f8a9 100644 --- a/sys/powerpc/booke/pmap.c +++ b/sys/powerpc/booke/pmap.c @@ -1115,8 +1115,8 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_offset_t kernelend) /* Allocate PTE tables for kernel KVA. */ kernel_pdir = data_end; - kernel_ptbls = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS + - PDIR_SIZE - 1) / PDIR_SIZE; + kernel_ptbls = howmany(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS, + PDIR_SIZE); data_end += kernel_ptbls * PTBL_PAGES * PAGE_SIZE; debugf(" kernel ptbls: %d\n", kernel_ptbls); debugf(" kernel pdir at 0x%08x end = 0x%08x\n", kernel_pdir, data_end); -- cgit v1.1