/* When allocating memory we should always start from the highest address chunk, so sort the memory list such that the first list iterator gets the highest address and goes lower from there.  */
static int efi_mem_cmp(void *priv, struct list_head *a, struct list_head *b)
/* When allocating memory we should always start from the highest address chunk, so sort the memory list such that the first list iterator gets the highest address and goes lower from there.  */
static int efi_mem_cmp(void *priv, struct list_head *a, struct list_head *b)
{
	struct efi_mem_list *mema = list_entry(a, struct efi_mem_list, link);
	struct efi_mem_list *memb = list_entry(b, struct efi_mem_list, link);
	if (mema->desc.physical_start == memb->desc.physical_start)
		return 0;
	else if (mema->desc.physical_start < memb->desc.physical_start)
		return 1;
	else
		return -1;
}