Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753838AbdLMUSL (ORCPT ); Wed, 13 Dec 2017 15:18:11 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:46564 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752932AbdLMUSI (ORCPT ); Wed, 13 Dec 2017 15:18:08 -0500 From: Colin King To: Boris Brezillon , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Cyrille Pitchen , linux-mtd@lists.infradead.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][mtd-next] mtd: nand: remove redundant check of len Date: Wed, 13 Dec 2017 20:17:43 +0000 Message-Id: <20171213201743.27324-1-colin.king@canonical.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 950 Lines: 31 From: Colin Ian King The check of len being zero is redundant as it has already been sanity checked for this value at the start of the function. Hence it is impossible for this test to be true and so the redundant code can be removed. Detected by CoverityScan, CID#1462748 ("Logically dead code") Signed-off-by: Colin Ian King --- drivers/mtd/nand/nand_base.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index afd5e18db81c..9daaa23db943 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -1507,10 +1507,6 @@ static int nand_read_param_page_op(struct nand_chip *chip, u8 page, void *buf, }; struct nand_operation op = NAND_OPERATION(instrs); - /* Drop the DATA_IN instruction if len is set to 0. */ - if (!len) - op.ninstrs--; - return nand_exec_op(chip, &op); } -- 2.14.1