Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115998
b: refs/heads/master
c: ccbcd6c
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Aug 16, 2008
1 parent d685071 commit ca8dfb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e6cf5df1838c28bb060ac45b5585e48e71bbc740
refs/heads/master: ccbcd6cba5ef6e071deb072188ad044921f6b91e
20 changes: 9 additions & 11 deletions trunk/drivers/mtd/nand/nand_ecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
*
* drivers/mtd/nand/nand_ecc.c
*
* Copyright (C) 2008 Koninklijke Philips Electronics NV.
* Author: Frans Meulenbroeks
* Copyright © 2008 Koninklijke Philips Electronics NV.
* Author: Frans Meulenbroeks
*
* Completely replaces the previous ECC implementation which was written by:
* Steven J. Hill (sjhill@realitydiluted.com)
* Thomas Gleixner (tglx@linutronix.de)
*
* Information on how this algorithm works and how it was developed
* can be found in Documentation/nand/ecc.txt
* can be found in Documentation/mtd/nand_ecc.txt
*
* This file is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
Expand All @@ -35,7 +35,7 @@
* e.g. when running the code in a testbed or a benchmark program.
* When STANDALONE is used, the module related macros are commented out
* as well as the linux include files.
* Instead a private definition of mtd_into is given to satisfy the compiler
* Instead a private definition of mtd_info is given to satisfy the compiler
* (the code does not use mtd_info, so the code does not care)
*/
#ifndef STANDALONE
Expand All @@ -44,10 +44,8 @@
#include <linux/module.h>
#include <linux/mtd/nand_ecc.h>
#else
typedef uint32_t unsigned long
struct mtd_info {
int dummy;
};
#include <stdint.h>
struct mtd_info;
#define EXPORT_SYMBOL(x) /* x */

#define MODULE_LICENSE(x) /* x */
Expand Down Expand Up @@ -409,7 +407,7 @@ int nand_correct_data(struct mtd_info *mtd, unsigned char *buf,
/* repeated if statements are slightly more efficient than switch ... */
/* ordered in order of likelihood */
if (nr_bits == 0)
return (0); /* no error */
return 0; /* no error */
if (nr_bits == 11) { /* correctable error */
/*
* rp15/13/11/9/7/5/3/1 indicate which byte is the faulty byte
Expand All @@ -431,10 +429,10 @@ int nand_correct_data(struct mtd_info *mtd, unsigned char *buf,
bit_addr = addressbits[b2 >> 2];
/* flip the bit */
buf[byte_addr] ^= (1 << bit_addr);
return (1);
return 1;
}
if (nr_bits == 1)
return (1); /* error in ecc data; no action needed */
return 1; /* error in ecc data; no action needed */
return -1;
}
EXPORT_SYMBOL(nand_correct_data);
Expand Down

0 comments on commit ca8dfb0

Please sign in to comment.