mtd: onenand: drop dead code

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed Apr 22 10:59:03 PDT 2015


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=7f2a7ce17dcd381e366a65b6643239338a987715
Commit:     7f2a7ce17dcd381e366a65b6643239338a987715
Parent:     dc52499e7f2d9812cfa4aa3b8d84a3f2c97e068b
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Sat Feb 28 02:02:25 2015 -0800
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Wed Mar 11 15:21:47 2015 -0700

    mtd: onenand: drop dead code
    
    'ret' is always zero, so this is all dead code.
    
    This should quiet Coverity CID #1226739.
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Cc: Kyungmin Park <kyungmin.park at samsung.com>
---
 drivers/mtd/onenand/onenand_base.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 635ee00..43b3392 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -1743,7 +1743,6 @@ static int onenand_panic_write(struct mtd_info *mtd, loff_t to, size_t len,
 	struct onenand_chip *this = mtd->priv;
 	int column, subpage;
 	int written = 0;
-	int ret = 0;
 
 	if (this->state == FL_PM_SUSPENDED)
 		return -EBUSY;
@@ -1786,15 +1785,10 @@ static int onenand_panic_write(struct mtd_info *mtd, loff_t to, size_t len,
 		onenand_panic_wait(mtd);
 
 		/* In partial page write we don't update bufferram */
-		onenand_update_bufferram(mtd, to, !ret && !subpage);
+		onenand_update_bufferram(mtd, to, !subpage);
 		if (ONENAND_IS_2PLANE(this)) {
 			ONENAND_SET_BUFFERRAM1(this);
-			onenand_update_bufferram(mtd, to + this->writesize, !ret && !subpage);
-		}
-
-		if (ret) {
-			printk(KERN_ERR "%s: write failed %d\n", __func__, ret);
-			break;
+			onenand_update_bufferram(mtd, to + this->writesize, !subpage);
 		}
 
 		written += thislen;
@@ -1808,7 +1802,7 @@ static int onenand_panic_write(struct mtd_info *mtd, loff_t to, size_t len,
 	}
 
 	*retlen = written;
-	return ret;
+	return 0;
 }
 
 /**



More information about the linux-mtd-cvs mailing list