/* Check for a pattern at the given place. Used to search bad block tables and good / bad block identifiers.  */
static int check_pattern(uint8_t *buf, int len, int paglen, struct nand_bbt_descr *td)
/* Check for a pattern at the given place. Used to search bad block tables and good / bad block identifiers.  */
static int check_pattern(uint8_t *buf, int len, int paglen, struct nand_bbt_descr *td)
{
	if (td->options & NAND_BBT_NO_OOB)
		return check_pattern_no_oob(buf, td);
	if (memcmp(buf + paglen + td->offs, td->pattern, td->len))
		return -1;
	return 0;
}