mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 05:11:48 +00:00
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
@ -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 New Issue
Block a user