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

* Re: [Outreachy kernel] [PATCH] Staging: comedi: Use predefined macro offset_in_page() instead of (addr & ~PAGE_MASK).
  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 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2016-03-05  8:26 UTC (permalink / raw)
  To: Sandhya Bankar; +Cc: outreachy-kernel



On Sat, 5 Mar 2016, Sandhya Bankar wrote:

> 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)) {

Much nicer :)

julia

>  		retval = -EFAULT;
>  		goto done;
>  	}
> --
> 1.8.3.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160305000721.GA3072%40sandhya.
> For more options, visit https://groups.google.com/d/optout.
>


^ permalink raw reply	[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.