From: Akinobu Mita Date: Wed, 24 Aug 2011 23:47:07 +0000 (+1000) Subject: Use newly introduced memchr_inv() for page verification. X-Git-Tag: next-20110912~1^2~69 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=07d18ef0402d52a3903ab5f9c6fac84b11a9e137;p=karo-tx-linux.git Use newly introduced memchr_inv() for page verification. Signed-off-by: Akinobu Mita Signed-off-by: Andrew Morton --- 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--) {