summaryrefslogtreecommitdiffstats
path: root/drivers/video/fbmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r--drivers/video/fbmem.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index f6ca52705..6e409ddb4 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -432,8 +432,7 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
/* frame buffer memory */
start = fix.smem_start;
- len = (start & ~PAGE_MASK)+fix.smem_len;
- len = (len+~PAGE_MASK) & PAGE_MASK; /* someone's on crack. */
+ len = PAGE_ALIGN((start & ~PAGE_MASK)+fix.smem_len);
if (off >= len) {
/* memory mapped io */
off -= len;
@@ -441,8 +440,7 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
if (var.accel_flags)
return -EINVAL;
start = fix.mmio_start;
- len = (start & ~PAGE_MASK)+fix.mmio_len;
- len = (len+~PAGE_MASK) & PAGE_MASK;
+ len = PAGE_ALIGN((start & ~PAGE_MASK)+fix.mmio_len);
}
start &= PAGE_MASK;
if ((vma->vm_end - vma->vm_start + off) > len)