/* Check if an ID string is repeated within a given sequence of bytes at specific repetition interval period (e.g., {0x20,0x01,0x7F,0x20} has a period of 3). This is a helper function for nand_id_len(). Returns non-zero if the repetition has a period of @period; otherwise, returns zero.  */
static int nand_id_has_period(u8 *id_data, int arrlen, int period)
/* Check if an ID string is repeated within a given sequence of bytes at specific repetition interval period (e.g., {0x20,0x01,0x7F,0x20} has a period of 3). This is a helper function for nand_id_len(). Returns non-zero if the repetition has a period of @period; otherwise, returns zero.  */
static int nand_id_has_period(u8 *id_data, int arrlen, int period)
{
	int i, j;
	for (i = 0; i < period; i++)
		for (j = i + period; j < arrlen; j += period)
			if (id_data[i] != id_data[j])
				return 0;
	return 1;
}