lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1354278480.30168.116.camel@sauron.fi.intel.com>
Date:	Fri, 30 Nov 2012 14:28:00 +0200
From:	Artem Bityutskiy <artem.bityutskiy@...ux.intel.com>
To:	"Philip, Avinash" <avinashphilip@...com>
Cc:	dwmw2@...radead.org, afzal@...com, tony@...mide.com,
	broonie@...nsource.wolfsonmicro.com, rmk+kernel@....linux.org.uk,
	gregkh@...uxfoundation.org, linux-mtd@...ts.infradead.org,
	linux-kernel@...r.kernel.org, devicetree-discuss@...ts.ozlabs.org,
	linux-doc@...r.kernel.org, nsekhar@...com, gururaja.hebbar@...com,
	ivan.djelic@...rot.com
Subject: Re: [PATCH v2 3/3] mtd: nand: omap2: Support for hardware BCH error
 correction

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?

-- 
Best Regards,
Artem Bityutskiy

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ