mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-16 09:13:55 +08:00
mm/madvise.c: use PAGE_ALIGN[ED] for range checking
Improve readability, no functional change. Link: http://lkml.kernel.org/r/20191118032857.22683-1-richardw.yang@linux.intel.com Signed-off-by: Wei Yang <richardw.yang@linux.intel.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
d3cd257ce1
commit
df6c6500b4
@ -1059,9 +1059,9 @@ SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior)
|
|||||||
if (!madvise_behavior_valid(behavior))
|
if (!madvise_behavior_valid(behavior))
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
if (start & ~PAGE_MASK)
|
if (!PAGE_ALIGNED(start))
|
||||||
return error;
|
return error;
|
||||||
len = (len_in + ~PAGE_MASK) & PAGE_MASK;
|
len = PAGE_ALIGN(len_in);
|
||||||
|
|
||||||
/* Check to see whether len was rounded up from small -ve to zero */
|
/* Check to see whether len was rounded up from small -ve to zero */
|
||||||
if (len_in && !len)
|
if (len_in && !len)
|
||||||
|
Loading…
Reference in New Issue
Block a user