diff options
author | Fengguang Wu <fengguang.wu@intel.com> | 2015-07-29 00:08:48 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-07-29 00:13:22 -0700 |
commit | a04c0aef74bbd807cd43ffa12404c3d6a6021865 (patch) | |
tree | ea5cc423c8ba5251c3076c0d8350cdc35d388176 /drivers/net/ethernet/stmicro | |
parent | 6d85d0e38730c2a55beffe4a9617d89fbd34037c (diff) | |
download | blackbird-op-linux-a04c0aef74bbd807cd43ffa12404c3d6a6021865.tar.gz blackbird-op-linux-a04c0aef74bbd807cd43ffa12404c3d6a6021865.zip |
stmmac: fix ptr_ret.cocci warning
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:304:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
Generated by: scripts/coccinelle/api/ptr_ret.cocci
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
[je: rebase and insert newline before return]
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index eca0eb845241..1dcb5ebefe5c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -298,10 +298,8 @@ int stmmac_get_platform_resources(struct platform_device *pdev, res = platform_get_resource(pdev, IORESOURCE_MEM, 0); stmmac_res->addr = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(stmmac_res->addr)) - return PTR_ERR(stmmac_res->addr); - return 0; + return PTR_ERR_OR_ZERO(stmmac_res->addr); } EXPORT_SYMBOL_GPL(stmmac_get_platform_resources); |