/* Scan PDR for the record with the specified RECORD_ID. If it's not found, return NULL.  */
static const struct pdr* hermes_find_pdr(const struct pdr *first_pdr, u32 record_id, const void *end)
/* Scan PDR for the record with the specified RECORD_ID. If it's not found, return NULL.  */
static const struct pdr* hermes_find_pdr(const struct pdr *first_pdr, u32 record_id, const void *end)
{
	const struct pdr *pdr = first_pdr;
	end -= sizeof(struct pdr);
	while (((void *) pdr <= end) &&
	       (pdr_id(pdr) != PDI_END)) {
		if (pdr_len(pdr) < 2)
			return NULL;
		if (pdr_id(pdr) == record_id)
			return pdr;
		pdr = (struct pdr *) pdr->next;
	}
	return NULL;
}