[U-Boot] [PATCH v7 3/5] mtd: nand: omap: optimize chip->ecc.calculate() for H/W ECC schemes

Scott Wood scottwood at freescale.com
Tue Oct 8 19:28:40 CEST 2013


On Mon, 2013-09-30 at 19:43 +0530, Pekon Gupta wrote:
> +	/* ECC scheme specific syndrome customizations */
> +	switch (bch->ecc_scheme) {
> +	case OMAP_ECC_HAM1_CODE_HW:
> +		break;
> +	case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW:
> +#ifdef CONFIG_BCH
> +		for (i = 0; i < chip->ecc.bytes; i++)
> +			*(ecc_code + i) = *(ecc_code + i) ^
> +						bch8_polynomial[i];
> +#endif
> +		break;
> +	case OMAP_ECC_BCH8_CODE_HW:
> +		ecc_code[chip->ecc.bytes - 1] = 0x00;
> +		break;
> +	default:
> +		return -EINVAL;
>  	}

Shouldn't "case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW:" be inside the
"#ifdef CONFIG_BCH" so that you get -EINVAL if the implementation isn't
there?

-Scott





More information about the U-Boot mailing list