/* Return link and relative domain id based on absolute domain id.  */
static const struct log_link* get_link_domain(uint8_t domain_id, uint8_t *rel_domain_id)
/* Return link and relative domain id based on absolute domain id.  */
static const struct log_link* get_link_domain(uint8_t domain_id, uint8_t *rel_domain_id)
{
	uint8_t domain_max;
	STRUCT_SECTION_FOREACH(log_link, link) {
		domain_max = link->ctrl_blk->domain_offset +
				link->ctrl_blk->domain_cnt;
		if (domain_id < domain_max) {
			*rel_domain_id = domain_id - link->ctrl_blk->domain_offset;
			return link;
		}
	}
	*rel_domain_id = 0;
	return NULL;
}