All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: comedi: Use predefined macro offset_in_page() instead of (addr & ~PAGE_MASK).
@ 2016-03-05  0:07 Sandhya Bankar
  2016-03-05  8:26 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 2+ messages in thread
From: Sandhya Bankar @ 2016-03-05  0:07 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>
---
 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] 2+ messages in thread

end of thread, other threads:[~2016-03-05  8:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-05  0:07 [PATCH] Staging: comedi: Use predefined macro offset_in_page() instead of (addr & ~PAGE_MASK) Sandhya Bankar
2016-03-05  8:26 ` [Outreachy kernel] " Julia Lawall

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.