From patchwork Sat Nov 26 18:05:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 84293 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp787499obn; Sat, 26 Nov 2016 10:12:49 -0800 (PST) X-Received: by 10.84.142.1 with SMTP id 1mr30269903plw.87.1480183969185; Sat, 26 Nov 2016 10:12:49 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3si20797901plb.121.2016.11.26.10.12.48; Sat, 26 Nov 2016 10:12:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753663AbcKZSMe (ORCPT + 25 others); Sat, 26 Nov 2016 13:12:34 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:48261 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753233AbcKZSI0 (ORCPT ); Sat, 26 Nov 2016 13:08:26 -0500 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-11.nifty.com with ESMTP id uAQI6Uef018512; Sun, 27 Nov 2016 03:06:40 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com uAQI6Uef018512 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1480183601; bh=6vNe7+ytorI19EIV4uoA3QUhZKlEIsI/drn7u0wr15s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LXv6IKfTFwhQUPr4TKjKYZtRcnxSuTy3dW5Ao8LE6bPpHJ/YkxqAs9dEuXQYL34vt ZjjZ+xa8SG8iQ6ROLgeGf4QugKvieBUWQWlMirF0BaQgh9p9hHhb614y+eW3o2XEcR w9ZtFxMTXW9FaATwaqezfI7avVdAzQGkrP4C1//qKLSZoDz4pZmVRtv5Zl5COen/Zs pwsKlp+6D+M/v/OHUch3AaWgLwOqTS2IaGhQ524Q4927JN4EE/L9pWHp8isYF69vBK ph0fGpu9oBOljpZP5QXeGpUriz/1vpX5QthUrE92w+SkLEaqrsFJqJfzkn9utoFysv gkT+xlLUWR5pQ== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org, Boris Brezillon , Marek Vasut , Brian Norris , Richard Weinberger , David Woodhouse , Cyrille Pitchen Subject: [PATCH 09/39] mtd: nand: denali: fix erased page check code Date: Sun, 27 Nov 2016 03:05:55 +0900 Message-Id: <1480183585-592-10-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480183585-592-1-git-send-email-yamada.masahiro@socionext.com> References: <1480183585-592-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, is_erased() is called against "buf" twice, so the second call is meaningless. The second one should be checked against chip->oob_poi. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/denali.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index cbc7f75..753e9a02 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -1160,7 +1160,7 @@ static int denali_read_page(struct mtd_info *mtd, struct nand_chip *chip, if (check_erased_page) { if (!is_erased(buf, mtd->writesize)) mtd->ecc_stats.failed++; - if (!is_erased(buf, mtd->oobsize)) + if (!is_erased(chip->oob_poi, mtd->oobsize)) mtd->ecc_stats.failed++; } }