From patchwork Tue Apr 12 07:30:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zengzhaoxiu@163.com X-Patchwork-Id: 8807671 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 042619F39A for ; Tue, 12 Apr 2016 07:32:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2929B20320 for ; Tue, 12 Apr 2016 07:32:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F768202D1 for ; Tue, 12 Apr 2016 07:32:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755974AbcDLHc2 (ORCPT ); Tue, 12 Apr 2016 03:32:28 -0400 Received: from m50-134.163.com ([123.125.50.134]:33603 "EHLO m50-134.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755917AbcDLHc1 (ORCPT ); Tue, 12 Apr 2016 03:32:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=hs9HLaiM4aI54BRpnO DLNN0GTvg2Qseihu9GwZ2ZpMA=; b=ZqNlpf8gie4jBN0TYh2tLchmoQseGtWFy7 jyVXOTxxaj6AOcpe56eWJCIXwQ7Zzy2dREPpyKnnXcEKCtbx6m4J8Z4K/DxKSfwC SMtYYgoFU0ARpCVjyfmci9iTx9fc+LdPhfjjpXlSP6GmyvGUD4QhHcFsrnbV1TQG VwK6xGWpk= Received: from zhaoxiuzeng-VirtualBox.spreadtrum.com (unknown [112.95.225.98]) by smtp4 (Coremail) with SMTP id DtGowABHDmAdpAxXymJyAQ--.34090S2; Tue, 12 Apr 2016 15:30:44 +0800 (CST) From: zengzhaoxiu@163.com To: boris.brezillon@free-electrons.com Cc: kgene@kernel.org, k.kozlowski@samsung.com, richard@nod.at, dwmw2@infradead.org, computersforpeace@gmail.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Zhaoxiu Zeng Subject: [PATCH] mtd: nand: s3c2410: fix bug in s3c2410_nand_correct_data() Date: Tue, 12 Apr 2016 15:30:35 +0800 Message-Id: <1460446235-987-1-git-send-email-zengzhaoxiu@163.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <20160411094901.74e68f91@bbrezillon> References: <20160411094901.74e68f91@bbrezillon> X-CM-TRANSID: DtGowABHDmAdpAxXymJyAQ--.34090S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7XF45Kw18Ar18Jr1UCFyUZFb_yoWfJrbEgw 12qw1xKw4DAr1UWFn5JwsIvryaka1rWw18u3WFvwnxtayUCryfJa4DWF90vrn8ur4rXFyU CrZFv39xGr929jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU583ktUUUUU== X-Originating-IP: [112.95.225.98] X-CM-SenderInfo: p2hqw6xkdr5xrx6rljoofrz/1tbiGQVJgFXlSJNgHAAAsC Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Zhaoxiu Zeng If there is only one bit difference in the ECC, the function should return 1. The result of "diff0 & ~(1< --- drivers/mtd/nand/s3c2410.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index 9c9397b..86ffb73 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c @@ -542,7 +542,8 @@ static int s3c2410_nand_correct_data(struct mtd_info *mtd, u_char *dat, diff0 |= (diff1 << 8); diff0 |= (diff2 << 16); - if ((diff0 & ~(1<