diff options
author | pfg <pfg@FreeBSD.org> | 2016-04-21 19:57:40 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-04-21 19:57:40 +0000 |
commit | 729533413f4e97bb65852c22fb914805e2759b5a (patch) | |
tree | cd4dfa8859a5f57124d315ff395b524d7587e1ea /sys/amd64 | |
parent | 0d55061d05ce55d28aff0c06bad831448d172425 (diff) | |
download | FreeBSD-src-729533413f4e97bb65852c22fb914805e2759b5a.zip FreeBSD-src-729533413f4e97bb65852c22fb914805e2759b5a.tar.gz |
sys: use our roundup2/rounddown2() macros when param.h is available.
rounddown2 tends to produce longer lines than the original code
and when the code has a high indentation level it was not really
advantageous to do the replacement.
This tries to strike a balance between readability using the macros
and flexibility of having the expressions, so not everything is
converted.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/amd64_mem.c | 2 | ||||
-rw-r--r-- | sys/amd64/amd64/pmap.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/amd64/amd64/amd64_mem.c b/sys/amd64/amd64/amd64_mem.c index f07a886..aa8dc5c 100644 --- a/sys/amd64/amd64/amd64_mem.c +++ b/sys/amd64/amd64/amd64_mem.c @@ -383,7 +383,7 @@ amd64_mrstoreone(void *arg) /* mask/active register */ if (mrd->mr_flags & MDF_ACTIVE) { msrv = MTRR_PHYSMASK_VALID | - (~(mrd->mr_len - 1) & mtrr_physmask); + rounddown2(mtrr_physmask, mrd->mr_len); } else { msrv = 0; } diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index d2d0248..dedf9e5 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -496,7 +496,7 @@ pmap_kmem_choose(vm_offset_t addr) { vm_offset_t newaddr = addr; - newaddr = (addr + (NBPDR - 1)) & ~(NBPDR - 1); + newaddr = roundup2(addr, NBPDR); return (newaddr); } |