summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>2017-07-03 19:13:34 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-16 08:41:01 +0200
commitf47d8b11eeaf32fa124cf006ef9f4ef6d63c9d50 (patch)
tree185a61f570516520d9757db56a6881334756a6a6 /drivers
parent2fcd74b7c2a60bcbcdb84fce92fed2f83b247a61 (diff)
staging: comedi: Use offset_in_page macro
Use offset_in_page macro instead of (var & ~PAGE_MASK) The Coccinelle semantic patch used to make this change is as follows: // <smpl> @@ unsigned long p; @@ - p & ~PAGE_MASK + offset_in_page(p) // </smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/comedi/comedi_buf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index 8e9b30b26810..b455ff6714eb 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -165,7 +165,7 @@ int comedi_buf_map_put(struct comedi_buf_map *bm)
int comedi_buf_map_access(struct comedi_buf_map *bm, unsigned long offset,
void *buf, int len, int write)
{
- unsigned int pgoff = offset & ~PAGE_MASK;
+ unsigned int pgoff = offset_in_page(offset);
unsigned long pg = offset >> PAGE_SHIFT;
int done = 0;