[PATCH v2 12/19] mtd: nand_mrvl_nfc: Prepare for different HW ECC strengths

Trent Piepho tpiepho at kymetacorp.com
Fri Nov 20 12:38:28 PST 2015


On Fri, 2015-11-20 at 20:36 +0100, Sebastian Hesselbarth wrote:

> +
> +static int pxa_ecc_init(struct mrvl_nand_host *host,
> +			struct nand_ecc_ctrl *ecc,
> +			int strength, int ecc_stepsize, int page_size)
> +{
> +	int ret = -ENODEV;
> +
> +	switch (strength) {
> +	case 1:
> +		ret = pxa_ecc_strength1(host, ecc, ecc_stepsize, page_size);
> +		break;
> +	}

It would be a bit more clear to write this as:

switch (strength) {
case 1:
        ret = pxa_ecc_strength1(...);
        break;
default:
        ret = -ENODEV;
        break;
}



More information about the barebox mailing list