[PATCH 2/4] MTD: flash drivers set ecc strength
Mike Dunn
mikedunn at newsguy.com
Mon Apr 2 13:34:12 EDT 2012
Brian,
I was just reviewing things and realized that I accidentally ignored one of your
comments...
On 03/29/2012 10:24 AM, Brian Norris wrote:
>>
>> case NAND_ECC_SOFT_BCH:
>> @@ -3384,6 +3385,8 @@ int nand_scan_tail(struct mtd_info *mtd)
>> pr_warn("BCH ECC initialization failed!\n");
>> BUG();
>> }
>> + chip->ecc.strength =
>> + chip->ecc.bytes*8 / fls(8*chip->ecc.size);
>
> Isn't this spacing against coding style? I'd suggest spaces around the
> '*'. Also, after a few minutes, I have no idea where this calculation
> comes from. But I'm not familiar with SOFT_BCH. Maybe a comment is in
> order?
I'm no bch expert myself (ping, Ivan), but I believe this is correct, and it is
consistant with the equations used to determine the 't' parameter (i.e.,
ecc_strength) from nand_bch_init() in drivers/mtd/nand/nand_bch.c. (BTW,
currently only nandsim uses SOFT_BCH.) As for coding style... honestly, I
mostly just rely on checkpatch.pl, but I'll check the style guide document.
Thanks,
Mike
More information about the linux-mtd
mailing list