Skip to content

Commit e7bbdd0

Browse files
0xAXtorvalds
authored andcommitted
mm/mincore: 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>
1 parent 1824cb7 commit e7bbdd0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎mm/mincore.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ SYSCALL_DEFINE3(mincore, unsigned long, start, size_t, len,
234234

235235
/* This also avoids any overflows on PAGE_CACHE_ALIGN */
236236
pages = len >> PAGE_SHIFT;
237-
pages += (len & ~PAGE_MASK) != 0;
237+
pages += (offset_in_page(len)) != 0;
238238

239239
if (!access_ok(VERIFY_WRITE, vec, pages))
240240
return -EFAULT;

0 commit comments

Comments
 (0)