[PATCH v2 2/7] memory: atmel-ebi: Simplify SMC config code

ian.eperson at dedf.co.uk ian.eperson at dedf.co.uk
Wed Aug 30 05:53:57 PDT 2017


This patch appears to result in the following code at the end of 
atmel_ebi_xslate_smc_config() – lines 265++:

	ret = atmel_ebi_xslate_smc_timings(ebid, np, &conf->smcconf);
	if (ret)
		return -EINVAL;

	if ((ret > 0 && !required) || (!ret && required)) {
		dev_err(ebid->ebi->dev, "missing atmel,smc- properties in %s",
			np->full_name);
		return -EINVAL;
	}

	return required;

My understanding is that atmel_ebi_xslate_smc_timings() returns true 
(>0), false (0) or error (<0) so the first test here should be:

	if(ret<0)

Otherwise the logic in the second test can be reduced to:

	if(required)

and some further changes to atmel_ebi_xslate_smc_timings() are needed


Regards



Ian Eperson
DeDf Co Ltd




More information about the linux-arm-kernel mailing list