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:
Todd Poynor
2018-07-19 20:49:13 -07:00
committed by Greg Kroah-Hartman
parent 0b184cc865
commit fd5d76ab69

View File

@@ -1591,7 +1591,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);