projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d3cd257
)
mm/madvise.c: use PAGE_ALIGN[ED] for range checking
author
Wei Yang
<richardw.yang@linux.intel.com>
Sun, 1 Dec 2019 01:57:46 +0000
(17:57 -0800)
committer
Linus Torvalds
<torvalds@linux-foundation.org>
Sun, 1 Dec 2019 20:59:09 +0000
(12:59 -0800)
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>
mm/madvise.c
patch
|
blob
|
history
diff --git
a/mm/madvise.c
b/mm/madvise.c
index e808dbeb27f39bbd9cce68f678c531ac334788fa..bcdb6a04278794ca97eea24cb59e8b7f04ab7111 100644
(file)
--- a/
mm/madvise.c
+++ b/
mm/madvise.c
@@
-1059,9
+1059,9
@@
SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior)
if (!madvise_behavior_valid(behavior))
return error;
- if (
start & ~PAGE_MASK
)
+ if (
!PAGE_ALIGNED(start)
)
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 */
if (len_in && !len)