From patchwork Mon Aug 9 04:20:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 61248 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 78EE71DD31 for ; Mon, 9 Aug 2010 14:22:41 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OiJrO-0000BD-TA; Mon, 09 Aug 2010 04:21:14 +0000 Received: from tango.tkos.co.il ([62.219.50.35]) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1OiJrH-0000A6-BG; Mon, 09 Aug 2010 04:21:08 +0000 Received: from jasper (89-139-33-111.bb.netvision.net.il [89.139.33.111]) (authenticated bits=0) by tango.tkos.co.il (8.14.4/8.12.11) with ESMTP id o794KpCV030652; Mon, 9 Aug 2010 07:20:54 +0300 From: Baruch Siach To: linux-mtd@lists.infradead.org Subject: [PATCH] nand: fix .correct callback return value check Date: Mon, 9 Aug 2010 07:20:23 +0300 Message-Id: X-Mailer: git-send-email 1.7.1 In-Reply-To: <20100808204341.GA20065@pengutronix.de> References: <20100808204341.GA20065@pengutronix.de> X-Spam-Level: -2.212 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.62 on 62.219.50.35 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100809_002107_773789_C5F53B1A X-CRM114-Status: GOOD ( 11.23 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Baruch Siach , Russell King - ARM Linux , John Ogness , Sascha Hauer , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Drivers may (and do) return negative errno values other than -1 from the .correct callback. Signed-off-by: Baruch Siach --- drivers/mtd/nand/nand_base.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 4a7b864..080f551 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -1210,7 +1210,7 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip, uint3 int stat; stat = chip->ecc.correct(mtd, p, &chip->buffers->ecccode[i], &chip->buffers->ecccalc[i]); - if (stat == -1) + if (stat < 0) mtd->ecc_stats.failed++; else mtd->ecc_stats.corrected += stat;