/* fit_calc_size() - Calculate the approximate size of the FIT we will generate  */
static int fit_calc_size(struct image_tool_params *params)
/* fit_calc_size() - Calculate the approximate size of the FIT we will generate  */
static int fit_calc_size(struct image_tool_params *params)
{
	struct content_info *cont;
	int size, total_size;
	size = imagetool_get_filesize(params, params->datafile);
	if (size < 0)
		return -1;
	total_size = size;
	if (params->fit_ramdisk) {
		size = imagetool_get_filesize(params, params->fit_ramdisk);
		if (size < 0)
			return -1;
		total_size += size;
	}
	for (cont = params->content_head; cont; cont = cont->next) {
		size = imagetool_get_filesize(params, cont->fname);
		if (size < 0)
			return -1;
		total_size += size + 300;
	}
	total_size += 4096;
	return total_size;
}