/* This is the actual size of code+data in the image, as opposed to the amount of space reserved in flash for that image. This code is similar to that used by the real EC code base. */
static int get_image_used(struct ec_state *ec, struct fmap_entry *entry)
/* This is the actual size of code+data in the image, as opposed to the amount of space reserved in flash for that image. This code is similar to that used by the real EC code base. */
static int get_image_used(struct ec_state *ec, struct fmap_entry *entry)
{
	int size;
	for (size = entry->length - 1;
	     size > 0 && ec->flash_data[entry->offset + size] != 0xea;
	     size--)
		;
	return size ? size + 1 : 0;
}