diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2011-10-31 20:08:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-31 20:30:47 -0400 |
commit | 8c5fb8eadde41f67c61a7ac2d3246dab87bf7020 (patch) | |
tree | 77d333e6e5f939c43ee57f16f499764e3ddb815a /mm/debug-pagealloc.c | |
parent | 798248206b59acc6e1238c778281419c041891a7 (diff) |
mm/debug-pagealloc.c: use memchr_inv
Use newly introduced memchr_inv() for page verification.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/debug-pagealloc.c')
-rw-r--r-- | mm/debug-pagealloc.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/mm/debug-pagealloc.c b/mm/debug-pagealloc.c index a4b6d707a31f..2618933efdb3 100644 --- a/mm/debug-pagealloc.c +++ b/mm/debug-pagealloc.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #include <linux/kernel.h> | 1 | #include <linux/kernel.h> |
2 | #include <linux/string.h> | ||
2 | #include <linux/mm.h> | 3 | #include <linux/mm.h> |
3 | #include <linux/page-debug-flags.h> | 4 | #include <linux/page-debug-flags.h> |
4 | #include <linux/poison.h> | 5 | #include <linux/poison.h> |
@@ -64,11 +65,8 @@ static void check_poison_mem(unsigned char *mem, size_t bytes) | |||
64 | unsigned char *start; | 65 | unsigned char *start; |
65 | unsigned char *end; | 66 | unsigned char *end; |
66 | 67 | ||
67 | for (start = mem; start < mem + bytes; start++) { | 68 | start = memchr_inv(mem, PAGE_POISON, bytes); |
68 | if (*start != PAGE_POISON) | 69 | if (!start) |
69 | break; | ||
70 | } | ||
71 | if (start == mem + bytes) | ||
72 | return; | 70 | return; |
73 | 71 | ||
74 | for (end = mem + bytes - 1; end > start; end--) { | 72 | for (end = mem + bytes - 1; end > start; end--) { |