p += td->len; end += td->len;
static int check_pattern (uint8_t *buf, int len, int paglen, struct nand_bbt_descr *td){	int i, end;	uint8_t *p = buf;	end = paglen + td->offs;	if (td->options & NAND_BBT_SCANEMPTY) {		for (i = 0; i < end; i++) {			if (p[i] != 0xff)				return -1;		}	}		p += end;		/* Compare the pattern */	for (i = 0; i < td->len; i++) {		if (p[i] != td->pattern[i])			return -1;	}	p += td->len;	end += td->len;	if (td->options & NAND_BBT_SCANEMPTY) {		for (i = end; i < len; i++) {			if (*p++ != 0xff)				return -1;		}	}	return 0;}