Staging: comedi: Use predefined macro offset_in_page() instead of (addr & ~PAGE_MASK).
authorSandhya Bankar <bankarsandhya512@gmail.com>
Sun, 6 Mar 2016 07:05:29 +0000 (12:35 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Mar 2016 03:34:22 +0000 (19:34 -0800)
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>
drivers/staging/comedi/comedi_fops.c

index d1cf6a1..7c7b477 100644 (file)
@@ -2224,7 +2224,7 @@ static int comedi_mmap(struct file *file, struct vm_area_struct *vma)
                retval = -EFAULT;
                goto done;
        }
-       if (size & (~PAGE_MASK)) {
+       if (offset_in_page(size)) {
                retval = -EFAULT;
                goto done;
        }