/* The function determines slot which is should we boot from among the two. */
static int ab_compare_slots(const struct slot_metadata *a, const struct slot_metadata *b)
/* The function determines slot which is should we boot from among the two. */
static int ab_compare_slots(const struct slot_metadata *a, const struct slot_metadata *b)
{
	if (a->priority != b->priority)
		return b->priority - a->priority;
	if (a->successful_boot != b->successful_boot)
		return b->successful_boot - a->successful_boot;
	if (a->tries_remaining != b->tries_remaining)
		return b->tries_remaining - a->tries_remaining;
	return 0;
}