Skip to content

Commit

Permalink
mm/debug-pagealloc.c: use memchr_inv
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed Nov 1, 2011
1 parent 7982482 commit 8c5fb8e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mm/debug-pagealloc.c
Original file line number Diff line number Diff line change
@@ -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>
Expand Down Expand Up @@ -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--) {
Expand Down

0 comments on commit 8c5fb8e

Please sign in to comment.