Skip to content

Commit

Permalink
mtd: nand: switch check_pattern()' to standard memcmp()'
Browse files Browse the repository at this point in the history
A portion of the `check_pattern()' function is basically a `memcmp()'.
Since it's possible for `memcmp()' to be optimized for a particular
architecture, we should use it instead.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
  • Loading branch information
Brian Norris authored and Artem Bityutskiy committed Sep 21, 2011
1 parent 6d77b9d commit 75b66d8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/mtd/nand/nand_bbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,8 @@ static int check_pattern(uint8_t *buf, int len, int paglen, struct nand_bbt_desc
p += end;

/* Compare the pattern */
for (i = 0; i < td->len; i++) {
if (p[i] != td->pattern[i])
return -1;
}
if (memcmp(p, td->pattern, td->len))
return -1;

if (td->options & NAND_BBT_SCANEMPTY) {
p += td->len;
Expand Down

0 comments on commit 75b66d8

Please sign in to comment.