Staging: comedi: Use predefined macro offset_in_page() instead of (addr & ~PAGE_MASK).
Use predefined macro offset_in_page() instead of (addr & ~PAGE_MASK).
Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index d1cf6a1..7c7b477 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2224,7 +2224,7 @@
retval = -EFAULT;
goto done;
}
- if (size & (~PAGE_MASK)) {
+ if (offset_in_page(size)) {
retval = -EFAULT;
goto done;
}