On Wed, Jun 2, 2010 at 00:22, <[email protected]> wrote:
> +static int bf5xx_nand_scan(struct mtd_info *mtd)
> +{
> + struct nand_chip *chip = mtd->priv;
> + int ret;
> +
> + ret = nand_scan_ident(mtd, 1);
> + if (!ret) {
> + if (hardware_ecc) {
> + /*
> + * for nand with page size > 512B, think it as several
> sections with
> 512B
> + */
> + if (mtd->writesize >= 512) {
> + chip->ecc.size = 512;
> + chip->ecc.bytes = 6;
> + bfin_write_NFC_CTL(bfin_read_NFC_CTL() | (1 <<
> NFC_PG_SIZE_OFFSET));
> + SSYNC();
> + } else {
> + chip->ecc.size = 256;
> + chip->ecc.bytes = 3;
> + }
> + }
> + ret = nand_scan_tail(mtd);
> + }
> + return ret;
> +}
checks that wrap the entire body of code really should be early
returns. otherwise this forces the entire function to be intended and
makes it ugly.
i.e. that first if check should simply be:
ret = nand_scan_ident(mtd, 1);
if (ret)
return ret;
-mike
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits