mm/msync: use offset_in_page macro
authorAlexander Kuleshov <kuleshovmail@gmail.com>
Fri, 6 Nov 2015 02:46:32 +0000 (18:46 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Nov 2015 03:34:48 +0000 (19:34 -0800)
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>
mm/msync.c

index bb04d53ae8529597d3b0ca6636c49d5243762875..24e612fefa04dc13eae85af00164d674c0b91940 100644 (file)
@@ -38,7 +38,7 @@ SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags)
 
        if (flags & ~(MS_ASYNC | MS_INVALIDATE | MS_SYNC))
                goto out;
-       if (start & ~PAGE_MASK)
+       if (offset_in_page(start))
                goto out;
        if ((flags & MS_ASYNC) && (flags & MS_SYNC))
                goto out;