diff mbox

[1/7] mtd: docg3: drop dead code

Message ID 1425117750-22298-2-git-send-email-computersforpeace@gmail.com
State Superseded
Headers show

Commit Message

Brian Norris Feb. 28, 2015, 10:02 a.m. UTC
If no devices were found, we would already have skipped over this code.

Detected by Coverity, CID #744270

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/mtd/devices/docg3.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Dan Carpenter March 2, 2015, 9:10 a.m. UTC | #1
On Sat, Feb 28, 2015 at 02:02:24AM -0800, Brian Norris wrote:
> diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
> index 448ce42f951e..01eddea1f0d9 100644
> --- a/drivers/mtd/devices/docg3.c
> +++ b/drivers/mtd/devices/docg3.c
> @@ -2079,8 +2079,6 @@ static int __init docg3_probe(struct platform_device *pdev)
>  	ret = doc_register_sysfs(pdev, cascade);
>  	if (ret)
>  		goto err_probe;
> -	if (!found)
> -		goto notfound;

Just delete the "found" variable because there are no other uses.

regards,
dan carpenter
Robert Jarzmik March 2, 2015, 9:39 p.m. UTC | #2
Dan Carpenter <dan.carpenter@oracle.com> writes:

> On Sat, Feb 28, 2015 at 02:02:24AM -0800, Brian Norris wrote:
>> diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
>> index 448ce42f951e..01eddea1f0d9 100644
>> --- a/drivers/mtd/devices/docg3.c
>> +++ b/drivers/mtd/devices/docg3.c
>> @@ -2079,8 +2079,6 @@ static int __init docg3_probe(struct platform_device *pdev)
>>  	ret = doc_register_sysfs(pdev, cascade);
>>  	if (ret)
>>  		goto err_probe;
>> -	if (!found)
>> -		goto notfound;
>
> Just delete the "found" variable because there are no other uses.
Yes, and yes.

For both changes (condition killing, found++ eradication and found variable
declaration) :
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

Cheers.
diff mbox

Patch

diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index 448ce42f951e..01eddea1f0d9 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -2079,8 +2079,6 @@  static int __init docg3_probe(struct platform_device *pdev)
 	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);