]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand: s3c2410: fix bug in s3c2410_nand_correct_data()
authorZhaoxiu Zeng <zhaoxiu.zeng@gmail.com>
Tue, 12 Apr 2016 07:30:35 +0000 (15:30 +0800)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Tue, 19 Apr 2016 20:04:53 +0000 (22:04 +0200)
commitc990a492df4f824e5b5b98e1ef1de3ff7e480f82
treeddc3880ce6dfb086056a73cd02d3125a0df77495
parentc87aa3091357b957e3bef8fee1caa1faeae0c9d6
mtd: nand: s3c2410: fix bug in s3c2410_nand_correct_data()

If there is only one bit difference in the ECC, the function should
return 1.
The result of "diff0 & ~(1<<fls(diff0))" is equal to diff0, so the
function actually returns -1.

Signed-off-by: Zhaoxiu Zeng <zhaoxiu.zeng@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/s3c2410.c