From patchwork Mon Feb 23 08:16:08 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Singh, Vimal" X-Patchwork-Id: 23555 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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 B50BCDDDA2 for ; Mon, 23 Feb 2009 19:19:01 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1LbVzC-0007Sb-Lo; Mon, 23 Feb 2009 08:16:22 +0000 Received: from comal.ext.ti.com ([198.47.26.152]) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1LbVz6-0007SS-LS for linux-mtd@lists.infradead.org; Mon, 23 Feb 2009 08:16:19 +0000 Received: from dlep36.itg.ti.com ([157.170.170.91]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id n1N8G9xf009742 for ; Mon, 23 Feb 2009 02:16:14 -0600 Received: from webmail.ti.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id n1N8G6DB021639 for ; Mon, 23 Feb 2009 02:16:08 -0600 (CST) Received: from 192.168.10.89 (proxying for 10.24.255.18) (SquirrelMail authenticated user x0094262); by dbdmail.itg.ti.com with HTTP; Mon, 23 Feb 2009 13:46:08 +0530 (IST) Message-ID: <58688.192.168.10.89.1235376968.squirrel@dbdmail.itg.ti.com> Date: Mon, 23 Feb 2009 13:46:08 +0530 (IST) Subject: [PATCH] [MTD] [NAND] nand_ecc.c: Bug fix in nand ecc From: "vimal singh" To: linux-mtd@lists.infradead.org User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 X-Priority: 3 (Normal) Importance: Normal X-Spam-Score: 0.0 (/) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Type of 'byte_addr' needed to change for 512 byte ecc support. Signed-off-by: Vimal Singh --- (((struct nand_chip *)mtd->priv)->ecc.size) >> 8; diff --git a/drivers/mtd/nand/nand_ecc.c b/drivers/mtd/nand/nand_ecc.c index 868147a..6b19058 100644 --- a/drivers/mtd/nand/nand_ecc.c +++ b/drivers/mtd/nand/nand_ecc.c @@ -429,7 +429,8 @@ int nand_correct_data(struct mtd_info *mtd, unsigned char *buf, unsigned char *read_ecc, unsigned char *calc_ecc) { unsigned char b0, b1, b2; - unsigned char byte_addr, bit_addr; + uint32_t byte_addr; + unsigned char bit_addr; /* 256 or 512 bytes/ecc */ const uint32_t eccsize_mult =