mtd: docg3: 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=dc52499e7f2d9812cfa4aa3b8d84a3f2c97e068b
Commit:     dc52499e7f2d9812cfa4aa3b8d84a3f2c97e068b
Parent:     98ebb521096f2d90c3e903ba79412cd92064795b
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Mon Mar 9 10:18:16 2015 -0700
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Wed Mar 11 15:21:19 2015 -0700

    mtd: docg3: drop dead code
    
    If no devices were found, we would already have skipped over this code.
    
    Detected by Coverity, CID #744270
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Acked-by: Robert Jarzmik <robert.jarzmik at free.fr>
---
 drivers/mtd/devices/docg3.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index 448ce42..0310f91 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -2033,7 +2033,7 @@ static int __init docg3_probe(struct platform_device *pdev)
 	struct mtd_info *mtd;
 	struct resource *ress;
 	void __iomem *base;
-	int ret, floor, found = 0;
+	int ret, floor;
 	struct docg3_cascade *cascade;
 
 	ret = -ENXIO;
@@ -2073,14 +2073,11 @@ static int __init docg3_probe(struct platform_device *pdev)
 						0);
 		if (ret)
 			goto err_probe;
-		found++;
 	}
 
 	ret = doc_register_sysfs(pdev, cascade);
 	if (ret)
 		goto err_probe;
-	if (!found)
-		goto notfound;
 
 	platform_set_drvdata(pdev, cascade);
 	doc_dbg_register(cascade->floors[0]->priv);



More information about the linux-mtd-cvs mailing list