lkml.org 
[lkml]   [2012]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2 3/3] mtd: nand: omap2: Support for hardware BCH error correction
Date
On Fri, Nov 30, 2012 at 17:58:00, Artem Bityutskiy wrote:
> On Wed, 2012-10-31 at 12:38 +0530, Philip, Avinash wrote:
> > +static int erased_sector_bitflips(u_char *data, u_char *oob,
> > + struct omap_nand_info *info)
> > +{
> > + int flip_bits = 0, i;
> > +
> > + for (i = 0; i < info->nand.ecc.size; i++) {
> > + flip_bits += hweight8(~data[i]);
> > + if (flip_bits > info->nand.ecc.strength)
> > + return 0;
> > + }
> > +
> > + for (i = 0; i < info->nand.ecc.bytes - 1; i++) {
> > + flip_bits += hweight8(~oob[i]);
> > + if (flip_bits > info->nand.ecc.strength)
> > + return 0;
> > + }
>
> Why do you need the second for loop?

BCH ecc is self protected & can correct bit flips in ecc bytes.
So here checking bit flips in read_ecc. I will rename variable
"oob" to "read_ecc"

Thanks
Avinash

>
> --
> Best Regards,
> Artem Bityutskiy
>

\
 
 \ /
  Last update: 2012-12-05 02:01    [W:0.052 / U:0.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site