Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75b66d8c authored by Brian Norris's avatar Brian Norris Committed by Artem Bityutskiy
Browse files

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: default avatarBrian Norris <computersforpeace@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@intel.com>
parent 6d77b9d0
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -107,10 +107,8 @@ static int check_pattern(uint8_t *buf, int len, int paglen, struct nand_bbt_desc
	p += end;
	p += end;


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


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