/* This function searches config region data to find the begining of the record specified by record_type. If record found, this function return pointer to the record else return NULL.  */
static uint8_t* lpfc_get_rec_conf23(uint8_t *buff, uint32_t size, uint8_t rec_type)
/* This function searches config region data to find the begining of the record specified by record_type. If record found, this function return pointer to the record else return NULL.  */
static uint8_t* lpfc_get_rec_conf23(uint8_t *buff, uint32_t size, uint8_t rec_type)
{
	uint32_t offset = 0, rec_length;
	if ((buff[0] == LPFC_REGION23_LAST_REC) ||
		(size < sizeof(uint32_t)))
		return NULL;
	rec_length = buff[offset + 1];
	while ((offset + rec_length * sizeof(uint32_t) + sizeof(uint32_t))
		<= size) {
		if (buff[offset] == rec_type)
			return &buff[offset];
		if (buff[offset] == LPFC_REGION23_LAST_REC)
			return NULL;
		offset += rec_length * sizeof(uint32_t) + sizeof(uint32_t);
		rec_length = buff[offset + 1];
	}
	return NULL;
}