Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751896AbbB1KDA (ORCPT ); Sat, 28 Feb 2015 05:03:00 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:42571 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751031AbbB1KCz (ORCPT ); Sat, 28 Feb 2015 05:02:55 -0500 From: Brian Norris To: Cc: Brian Norris , , kernel-janitors@vger.kernel.org, Kyungmin Park Subject: [PATCH 2/7] mtd: onenand: drop dead code Date: Sat, 28 Feb 2015 02:02:25 -0800 Message-Id: <1425117750-22298-3-git-send-email-computersforpeace@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1425117750-22298-1-git-send-email-computersforpeace@gmail.com> References: <1425117750-22298-1-git-send-email-computersforpeace@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1805 Lines: 57 'ret' is always zero, so this is all dead code. This should quiet Coverity CID #1226739. Signed-off-by: Brian Norris Cc: Kyungmin Park --- 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 635ee0027691..43b3392ffee7 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; } /** -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/