Skip to contentSkip to conversation

Staging: comedi: Use predefined macro offset_in_page() instead of (addr & ~PAGE_MASK).

PATCH New Sandhya Bankar 1 participant 1 message Mar 6, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Staging: comedi: Use predefined macro offset_in_page() instead of (addr & ~PAGE_MASK).

Use predefined macro offset_in_page() instead of (addr & ~PAGE_MASK).

---
Changes in v2:
* No change.
*Compile this patch to check nothing is broken.

 drivers/staging/comedi/comedi_fops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/comedi_fops.c +1 -1
index d1cf6a1..7c7b477 100644
@@ -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;
 	}
Signature · 1 line
1.8.3.4