All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Staging: comedi: Use predefined macro offset_in_page() instead of (addr & ~PAGE_MASK).
@ 2016-03-06  7:05 Sandhya Bankar
  0 siblings, 0 replies; only message in thread
From: Sandhya Bankar @ 2016-03-06  7:05 UTC (permalink / raw)
  To: outreachy-kernel

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

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---
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(-)

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 @@ 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;
 	}
-- 
1.8.3.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-03-06 15:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-06  7:05 [PATCH v2] Staging: comedi: Use predefined macro offset_in_page() instead of (addr & ~PAGE_MASK) Sandhya Bankar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.