lkml.org 
[lkml]   [2018]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 30/32] staging: gasket: gasket_mmap use PAGE_MASK
Date
From: Todd Poynor <toddpoynor@google.com>

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>
---
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 9a821614b0334..98d5a200aaa5a 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -1594,7 +1594,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.18.0.203.gfac676dfb9-goog
\
 
 \ /
  Last update: 2018-07-17 23:05    [W:1.647 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site