mtd: onenand: drop dead code
authorBrian Norris <computersforpeace@gmail.com>
Sat, 28 Feb 2015 10:02:25 +0000 (02:02 -0800)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 11 Mar 2015 22:21:47 +0000 (15:21 -0700)
'ret' is always zero, so this is all dead code.

This should quiet Coverity CID #1226739.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
drivers/mtd/onenand/onenand_base.c

index 635ee0027691eb771bc31eac771209b48987d8e2..43b3392ffee7e255555d88948e4dbe2aa47867d2 100644 (file)
@@ -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;
 }
 
 /**