aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nand/ecc_kw.c
diff options
context:
space:
mode:
authorSpencer Oliver <spen@spen-soft.co.uk>2012-01-31 11:07:53 +0000
committerSpencer Oliver <spen@spen-soft.co.uk>2012-02-06 10:53:08 +0000
commitfab0dcd7e6cb8cfbf63cb41f0978902371d30205 (patch)
treea7abd6895375f767b5439020d5bed10d8ecd2d88 /src/flash/nand/ecc_kw.c
parent1e9f8836a1af5b35b5950a24b8f19b38318df532 (diff)
downloadriscv-openocd-fab0dcd7e6cb8cfbf63cb41f0978902371d30205.zip
riscv-openocd-fab0dcd7e6cb8cfbf63cb41f0978902371d30205.tar.gz
riscv-openocd-fab0dcd7e6cb8cfbf63cb41f0978902371d30205.tar.bz2
build: cleanup src/flash/nand directory
Change-Id: I21bb466a35168cf04743f5baafac9fef50d01707 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/419 Tested-by: jenkins
Diffstat (limited to 'src/flash/nand/ecc_kw.c')
-rw-r--r--src/flash/nand/ecc_kw.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/flash/nand/ecc_kw.c b/src/flash/nand/ecc_kw.c
index 1c1a8ea..1c3cc70 100644
--- a/src/flash/nand/ecc_kw.c
+++ b/src/flash/nand/ecc_kw.c
@@ -28,7 +28,7 @@
* For multiplication, a discrete log/exponent table is used, with
* primitive element x (F is a primitive field, so x is primitive).
*/
-#define MODPOLY 0x409 /* x^10 + x^3 + 1 in binary */
+#define MODPOLY 0x409 /* x^10 + x^3 + 1 in binary */
/*
* Maps an integer a [0..1022] to a polynomial b = gf_exp[a] in
@@ -102,7 +102,7 @@ int nand_calculate_ecc_kw(struct nand_device *nand, const uint8_t *data, uint8_t
{
unsigned int r7, r6, r5, r4, r3, r2, r1, r0;
int i;
- static int tables_initialized = 0;
+ static int tables_initialized;
if (!tables_initialized) {
gf_build_log_exp_table();
@@ -121,7 +121,6 @@ int nand_calculate_ecc_kw(struct nand_device *nand, const uint8_t *data, uint8_t
r6 = data[510];
r7 = data[511];
-
/*
* Shift bytes 503..0 (in that order) into r0, followed
* by eight zero bytes, while reducing the polynomial by the