forked from MIrrors/gasket-driver
staging: gasket: gasket_mmap use PAGE_MASK
gasket_mmap use PAGE_MASK, instead of performing math on PAGE_SIZE, for simplicity and clarity. Reported-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Simon Que <sque@chromium.org> Signed-off-by: Todd Poynor <toddpoynor@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Alex Van Damme
parent
d99aa15f2e
commit
4e7e569724
@@ -1601,7 +1601,7 @@ static int gasket_mmap(struct file *filp, struct vm_area_struct *vma)
|
||||
}
|
||||
driver_desc = gasket_dev->internal_desc->driver_desc;
|
||||
|
||||
if (vma->vm_start & (PAGE_SIZE - 1)) {
|
||||
if (vma->vm_start & ~PAGE_MASK) {
|
||||
gasket_log_error(
|
||||
gasket_dev, "Base address not page-aligned: 0x%p\n",
|
||||
(void *)vma->vm_start);
|
||||
|
||||
Reference in New Issue
Block a user