mm/util: use offset_in_page macro
linux/mm.h provides offset_in_page() macro. Let's use already predefined macro instead of (addr & ~PAGE_MASK). Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
f09f1243ca
commit
ea53cde089
1 changed files with 1 additions and 1 deletions
|
@ -309,7 +309,7 @@ unsigned long vm_mmap(struct file *file, unsigned long addr,
|
|||
{
|
||||
if (unlikely(offset + PAGE_ALIGN(len) < offset))
|
||||
return -EINVAL;
|
||||
if (unlikely(offset & ~PAGE_MASK))
|
||||
if (unlikely(offset_in_page(offset)))
|
||||
return -EINVAL;
|
||||
|
||||
return vm_mmap_pgoff(file, addr, len, prot, flag, offset >> PAGE_SHIFT);
|
||||
|
|
Loading…
Reference in a new issue