From 15d5f73375faf7c03526fd6af72e487ed015d2c9 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Thu, 25 Aug 2011 09:47:07 +1000 Subject: [PATCH] Use newly introduced memchr_inv() for page verification. Signed-off-by: Akinobu Mita Signed-off-by: Andrew Morton --- mm/debug-pagealloc.c | 8 +++----- 1 file 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 +#include #include #include #include @@ -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--) { -- 2.39.5