lkml.org 
[lkml]   [2017]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH][mtd-next] mtd: nand: remove redundant check of len
Date
From: Colin Ian King <colin.king@canonical.com>

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 <colin.king@canonical.com>
---
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
\
 
 \ /
  Last update: 2017-12-13 21:18    [W:0.067 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site