/* It allows us to boot all slots in order from the first one. This value should be used when the bootloader message is corrupted, but not when a valid message indicates that all slots are unbootable. */
static int ab_control_default(struct bootloader_control *abc)
/* It allows us to boot all slots in order from the first one. This value should be used when the bootloader message is corrupted, but not when a valid message indicates that all slots are unbootable. */
static int ab_control_default(struct bootloader_control *abc)
{
	int i;
	const struct slot_metadata metadata = {
		.priority = 15,
		.tries_remaining = 7,
		.successful_boot = 0,
		.verity_corrupted = 0,
		.reserved = 0
	};
	if (!abc)
		return -EFAULT;
	memcpy(abc->slot_suffix, "a\0\0\0", 4);
	abc->magic = BOOT_CTRL_MAGIC;
	abc->version = BOOT_CTRL_VERSION;
	abc->nb_slot = NUM_SLOTS;
	memset(abc->reserved0, 0, sizeof(abc->reserved0));
	for (i = 0; i < abc->nb_slot; ++i)
		abc->slot_info[i] = metadata;
	memset(abc->reserved1, 0, sizeof(abc->reserved1));
	abc->crc32_le = ab_control_compute_crc(abc);
	return 0;
}