diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-04-21 19:57:40 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-04-21 19:57:40 +0000 |
commit | d9c9c81c083a76a65c6cacf8fcbc0511e2ffa489 (patch) | |
tree | cd4dfa8859a5f57124d315ff395b524d7587e1ea /sys/kern/sysv_shm.c | |
parent | 5977d3e898348ce714243a4189cee906151aa522 (diff) | |
download | src-d9c9c81c083a76a65c6cacf8fcbc0511e2ffa489.tar.gz src-d9c9c81c083a76a65c6cacf8fcbc0511e2ffa489.zip |
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.
Notes
Notes:
svn path=/head/; revision=298433
Diffstat (limited to 'sys/kern/sysv_shm.c')
-rw-r--r-- | sys/kern/sysv_shm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index b426f4561ef1..eeebc47fadca 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -370,7 +370,7 @@ kern_shmat_locked(struct thread *td, int shmid, const void *shmaddr, prot |= VM_PROT_WRITE; if (shmaddr != NULL) { if ((shmflg & SHM_RND) != 0) - attach_va = (vm_offset_t)shmaddr & ~(SHMLBA-1); + attach_va = rounddown2((vm_offset_t)shmaddr, SHMLBA); else if (((vm_offset_t)shmaddr & (SHMLBA-1)) == 0) attach_va = (vm_offset_t)shmaddr; else |