/* Used by the upper layer to verify the data in NAND Flash with the data in the buf.  */
static int mxc_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
/* Used by the upper layer to verify the data in NAND Flash with the data in the buf.  */
static int mxc_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
{
	u_char tmp[256];
	uint bsize;
	while (len) {
		bsize = min(len, 256);
		mxc_nand_read_buf(mtd, tmp, bsize);
		if (memcmp(buf, tmp, bsize))
			return 1;
		buf += bsize;
		len -= bsize;
	}
	return 0;
}