From fd5d76ab69a565ebcab94f11f185ea3dc5588249 Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Thu, 19 Jul 2018 20:49:13 -0700 Subject: [PATCH] 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 Signed-off-by: Simon Que Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c index 3cf918f9d260..ae5febec8844 100644 --- a/drivers/staging/gasket/gasket_core.c +++ b/drivers/staging/gasket/gasket_core.c @@ -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); -- 2.30.2