]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Use newly introduced memchr_inv() for page verification.
authorAkinobu Mita <akinobu.mita@gmail.com>
Wed, 24 Aug 2011 23:47:07 +0000 (09:47 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 9 Sep 2011 06:16:14 +0000 (16:16 +1000)
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/debug-pagealloc.c

index a4b6d707a31f5f4e459262344bdb1538cce8beab..2618933efdb361d974033380b00e5c86f6c31291 100644 (file)
@@ -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--) {