/* Requirement (1) ensures we can correct for the required bitflip density. Requirement (2) ensures we can correct even when all bitflips are clumped in the same sector.  */
static bool nand_ecc_strength_good(struct mtd_info *mtd)
/* Requirement (1) ensures we can correct for the required bitflip density. Requirement (2) ensures we can correct even when all bitflips are clumped in the same sector.  */
static bool nand_ecc_strength_good(struct mtd_info *mtd)
{
	struct nand_chip *chip = mtd_to_nand(mtd);
	struct nand_ecc_ctrl *ecc = &chip->ecc;
	int corr, ds_corr;
	if (ecc->size == 0 || chip->ecc_step_ds == 0)
		return true;
	corr = (mtd->writesize * ecc->strength) / ecc->size;
	ds_corr = (mtd->writesize * chip->ecc_strength_ds) / chip->ecc_step_ds;
	return corr >= ds_corr && ecc->strength >= chip->ecc_strength_ds;
}