Commit 8c5fb8eadde41f67c61a7ac2d3246dab87bf7020

Authored by Akinobu Mita
Committed by Linus Torvalds
1 parent 798248206b

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>

Showing 1 changed file with 3 additions and 5 deletions Side-by-side Diff

mm/debug-pagealloc.c
1 1 #include <linux/kernel.h>
  2 +#include <linux/string.h>
2 3 #include <linux/mm.h>
3 4 #include <linux/page-debug-flags.h>
4 5 #include <linux/poison.h>
... ... @@ -64,11 +65,8 @@
64 65 unsigned char *start;
65 66 unsigned char *end;
66 67  
67   - for (start = mem; start < mem + bytes; start++) {
68   - if (*start != PAGE_POISON)
69   - break;
70   - }
71   - if (start == mem + bytes)
  68 + start = memchr_inv(mem, PAGE_POISON, bytes);
  69 + if (!start)
72 70 return;
73 71  
74 72 for (end = mem + bytes - 1; end > start; end--) {