From patchwork Thu May 22 09:56:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ted Juan X-Patchwork-Id: 351413 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 033E714008A for ; Thu, 22 May 2014 19:58:25 +1000 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WnPk0-0005F9-Bz; Thu, 22 May 2014 09:56:48 +0000 Received: from mail-ve0-x22b.google.com ([2607:f8b0:400c:c01::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WnPjy-0005AC-4K for linux-mtd@lists.infradead.org; Thu, 22 May 2014 09:56:46 +0000 Received: by mail-ve0-f171.google.com with SMTP id oz11so4064936veb.16 for ; Thu, 22 May 2014 02:56:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=PmcI4IJgHMV4rMl/87cHDuMr9tjs29WoAMQhMBSRZaM=; b=sZ+n+CbK5PwI1iz3qtfl5vHHezxTjPl5ZErVhqT9wzWGLx46r3uvBR7tLUvKV76GHg XkFy6MIPEwXFdszXwiu1WHsn78Jndk9lJaS26YtoOv+XTPxYYbb+YKBQ6dVK8hT5qTFA 4c1PGmKHjXt7jDD8/hmSO8yLfVXGVZ+c/M8XRjrgUuclMW+kDvGarmjku1OxCPwaAx7t YRd8pq2OjUynYOh2S8rsRb9k3GX4Ptya6Y94OjC34fxBd/Hr8beSbYJxqVQIDbz4VbmI oZ4YtEIjUB4p1WcnoGuieCPljnay4jgj8eO2XbNFPc78Dea+E5iV6+WOBZ9EKV+7u9BS 7ALw== X-Received: by 10.58.126.135 with SMTP id my7mr36056780veb.27.1400752582640; Thu, 22 May 2014 02:56:22 -0700 (PDT) Received: from localhost.localdomain ([203.70.194.104]) by mx.google.com with ESMTPSA id nh8sm4378704veb.3.2014.05.22.02.56.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 May 2014 02:56:21 -0700 (PDT) From: "ted.juan" To: computersforpeace@gmail.com Subject: [PATCH] mtd: nand: omap: fix omap_calculate_ecc_bch() for-loop error Date: Thu, 22 May 2014 17:56:16 +0800 Message-Id: <1400752576-23110-1-git-send-email-ted.juan@gmail.com> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140522_025646_246195_80487E29 X-CRM114-Status: GOOD ( 10.76 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ted.juan[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Cc: "ted.juan" , linux-mtd@lists.infradead.org, pekon@ti.com X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 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" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: "ted.juan" I am sorry that I didn't use the git-send-mail last time. Signed-off-by: ted.juan --- drivers/mtd/nand/omap2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 1ff49b8..e21145a 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -1162,7 +1162,7 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd, struct gpmc_nand_regs *gpmc_regs = &info->reg; u8 *ecc_code; unsigned long nsectors, bch_val1, bch_val2, bch_val3, bch_val4; - int i; + int i, j; nsectors = ((readl(info->reg.gpmc_ecc_config) >> 4) & 0x7) + 1; for (i = 0; i < nsectors; i++) { @@ -1210,8 +1210,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd, case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW: /* Add constant polynomial to remainder, so that * ECC of blank pages results in 0x0 on reading back */ - for (i = 0; i < eccbytes; i++) - ecc_calc[i] ^= bch4_polynomial[i]; + for (j = 0; j < eccbytes; j++) + ecc_calc[j] ^= bch4_polynomial[j]; break; case OMAP_ECC_BCH4_CODE_HW: /* Set 8th ECC byte as 0x0 for ROM compatibility */ @@ -1220,8 +1220,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd, case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW: /* Add constant polynomial to remainder, so that * ECC of blank pages results in 0x0 on reading back */ - for (i = 0; i < eccbytes; i++) - ecc_calc[i] ^= bch8_polynomial[i]; + for (j = 0; j < eccbytes; j++) + ecc_calc[j] ^= bch8_polynomial[j]; break; case OMAP_ECC_BCH8_CODE_HW: /* Set 14th ECC byte as 0x0 for ROM compatibility */