Commit a04c0aef authored by Fengguang Wu's avatar Fengguang Wu Committed by David S. Miller

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: default avatarFengguang Wu <fengguang.wu@intel.com>
[je: rebase and insert newline before return]
Signed-off-by: default avatarJoachim Eastwood <manabian@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6d85d0e3
...@@ -298,10 +298,8 @@ int stmmac_get_platform_resources(struct platform_device *pdev, ...@@ -298,10 +298,8 @@ int stmmac_get_platform_resources(struct platform_device *pdev,
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
stmmac_res->addr = devm_ioremap_resource(&pdev->dev, res); 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); EXPORT_SYMBOL_GPL(stmmac_get_platform_resources);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment