From patchwork Sat Nov 26 18:05:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 84297 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp787933obn; Sat, 26 Nov 2016 10:14:02 -0800 (PST) X-Received: by 10.84.192.131 with SMTP id c3mr31483939pld.149.1480184042249; Sat, 26 Nov 2016 10:14:02 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 6si49339912pfl.234.2016.11.26.10.14.01; Sat, 26 Nov 2016 10:14:02 -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 S1753290AbcKZSNy (ORCPT + 25 others); Sat, 26 Nov 2016 13:13:54 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:48210 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753219AbcKZSI0 (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 uAQI6Ueg018512; Sun, 27 Nov 2016 03:06:41 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com uAQI6Ueg018512 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1480183601; bh=llVid1zzci5EgXU8+61lfHy8RNAqATi6lfngpfcjzBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IABedAXzfdUdxb1tiBwf5gm3sIfDgEqJ79IIJbUtwerHinWL2S3QoMsPYf6SCgoSh Z3jBFD2cgSpwhP5W794hEeqfbw0AYbIdafM1aYxjkLT8PNHJEev0LcNI4Ft1yUeIiK Lud8HnmUF2JO91/qpBhOL9YTD1Y6FTjqIqNOFryYXghmBndWuwvxvHLSyFAFvZUxif zxGMkUsRpD7a6IdRkxW+fe3gxjB8rz0VrRorRQI57Ir/ASP2bEaNYHn7pZa5lJf6mF LKsuL/YYiJHG8eHwNqRMNyiEVhn+26Ws/1rmc9sasz7T64ZUuB4qFIdH02RXKXtC7L FL/KM/9GusRaA== 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 10/39] mtd: nand: denali: remove redundant if conditional of erased_check Date: Sun, 27 Nov 2016 03:05:56 +0900 Message-Id: <1480183585-592-11-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 This code block is nested by double "if (check_erase_page)". Remove the redundant inner one. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/denali.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index 753e9a02..ab59371 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -1157,12 +1157,10 @@ static int denali_read_page(struct mtd_info *mtd, struct nand_chip *chip, read_oob_data(mtd, chip->oob_poi, denali->page); /* check ECC failures that may have occurred on erased pages */ - if (check_erased_page) { - if (!is_erased(buf, mtd->writesize)) - mtd->ecc_stats.failed++; - if (!is_erased(chip->oob_poi, mtd->oobsize)) - mtd->ecc_stats.failed++; - } + if (!is_erased(buf, mtd->writesize)) + mtd->ecc_stats.failed++; + if (!is_erased(chip->oob_poi, mtd->oobsize)) + mtd->ecc_stats.failed++; } return max_bitflips; }