提交 9b55669c 编写于 作者: M Markus Elfring 提交者: David S. Miller

NetCP: Deletion of unnecessary checks before two function calls

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: NMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f339664c
...@@ -2011,12 +2011,10 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev, ...@@ -2011,12 +2011,10 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
quit: quit:
if (gbe_dev->hw_stats) if (gbe_dev->hw_stats)
devm_kfree(dev, 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) if (gbe_dev->ss_regs)
devm_iounmap(dev, 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); devm_kfree(dev, gbe_dev);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册