[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <54D11FEF.10804@users.sourceforge.net>
Date: Tue, 03 Feb 2015 20:22:23 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: Murali Karicheri <m-karicheri2@...com>,
Wingman Kwok <w-kwok2@...com>, netdev@...r.kernel.org
CC: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH] NetCP: Deletion of unnecessary checks before two function
calls
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 3 Feb 2015 20:12:25 +0100
The functions cpsw_ale_destroy() and of_dev_put() test whether their argument
is NULL and then return immediately. Thus the test around the call
is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/net/ethernet/ti/netcp_ethss.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
index fa1041a..cbd6dde 100644
--- a/drivers/net/ethernet/ti/netcp_ethss.c
+++ b/drivers/net/ethernet/ti/netcp_ethss.c
@@ -2010,12 +2010,10 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
quit:
if (gbe_dev->hw_stats)
devm_kfree(dev, gbe_dev->hw_stats);
- if (gbe_dev->ale)
- cpsw_ale_destroy(gbe_dev->ale);
+ cpsw_ale_destroy(gbe_dev->ale);
if (gbe_dev->ss_regs)
devm_iounmap(dev, gbe_dev->ss_regs);
- if (interfaces)
- of_node_put(interfaces);
+ of_node_put(interfaces);
devm_kfree(dev, gbe_dev);
return ret;
}
--
2.2.2
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists