diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2011-10-31 17:08:10 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-31 17:30:47 -0700 |
commit | 8c5fb8eadde41f67c61a7ac2d3246dab87bf7020 (patch) | |
tree | 77d333e6e5f939c43ee57f16f499764e3ddb815a /mm | |
parent | 798248206b59acc6e1238c778281419c041891a7 (diff) | |
download | linux-8c5fb8eadde41f67c61a7ac2d3246dab87bf7020.tar.gz linux-8c5fb8eadde41f67c61a7ac2d3246dab87bf7020.tar.bz2 linux-8c5fb8eadde41f67c61a7ac2d3246dab87bf7020.zip |
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')
-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 @@ #include <linux/kernel.h> +#include <linux/string.h> #include <linux/mm.h> #include <linux/page-debug-flags.h> #include <linux/poison.h> @@ -64,11 +65,8 @@ static void check_poison_mem(unsigned char *mem, size_t bytes) unsigned char *start; unsigned char *end; - for (start = mem; start < mem + bytes; start++) { - if (*start != PAGE_POISON) - break; - } - if (start == mem + bytes) + start = memchr_inv(mem, PAGE_POISON, bytes); + if (!start) return; for (end = mem + bytes - 1; end > start; end--) { |