/* This function computes the length argument for the erase command. The length on which the command is to operate can be given in two forms: */
static int sf_parse_len_arg(char *arg, ulong *len)
/* This function computes the length argument for the erase command. The length on which the command is to operate can be given in two forms: */
static int sf_parse_len_arg(char *arg, ulong *len)
{
	char *ep;
	char round_up_len;
	ulong len_arg;
	round_up_len = 0;
	if (*arg == '+') {
		round_up_len = 1;
		++arg;
	}
	len_arg = simple_strtoul(arg, &ep, 16);
	if (ep == arg || *ep != '\0')
		return -1;
	if (round_up_len && flash->sector_size > 0)
		*len = ROUND(len_arg, flash->sector_size);
	else
		*len = len_arg;
	return 1;
}