Staging: comedi: Use predefined macro offset_in_page() instead of (addr & ~PAGE_MASK).
PATCH 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).
--- drivers/staging/comedi/comedi_fops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/comedi_fops.c +1 -1
@@ -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
Quoted 12 lines · Sandhya Bankar
Use predefined macro
offset_in_page()instead of (addr & ~PAGE_MASK).Signed-off-by Sandhya Bankar <[email protected]>--- drivers/staging/comedi/comedi_fops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/comedi/comedi_fops.c +0
-0
drivers/staging/comedi/comedi_fops.c static int comedi_mmap(struct file *file, struct vm_area_struct *vma) · line 2227
Quoted 5 lines
drivers/staging/comedi/comedi_fops.c +1
-1@@ -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
Quoted 13 lines
drivers/staging/comedi/comedi_fops.c +0
-1retval = -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 [email protected]. To post to this group, send email to [email protected].
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.