diff options
author | Brian Norris <computersforpeace@gmail.com> | 2011-09-07 16:13:41 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-21 02:19:08 -0400 |
commit | 75b66d8ccd5772b00a7328c2cf75bc506ec532a1 (patch) | |
tree | bf9a20d281e7501c3ea1d344e1da3ab141bf2f27 /drivers/mtd | |
parent | 6d77b9d0af57409c918ab9501866233082546ba6 (diff) |
mtd: nand: switch `check_pattern()' to standard `memcmp()'
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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/nand_bbt.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index 783093d1a2e5..5c9c0b2f09d4 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c | |||
@@ -107,10 +107,8 @@ static int check_pattern(uint8_t *buf, int len, int paglen, struct nand_bbt_desc | |||
107 | p += end; | 107 | p += end; |
108 | 108 | ||
109 | /* Compare the pattern */ | 109 | /* Compare the pattern */ |
110 | for (i = 0; i < td->len; i++) { | 110 | if (memcmp(p, td->pattern, td->len)) |
111 | if (p[i] != td->pattern[i]) | 111 | return -1; |
112 | return -1; | ||
113 | } | ||
114 | 112 | ||
115 | if (td->options & NAND_BBT_SCANEMPTY) { | 113 | if (td->options & NAND_BBT_SCANEMPTY) { |
116 | p += td->len; | 114 | p += td->len; |