Skip to content

Commit

Permalink
stmmac: fix ptr_ret.cocci warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fengguang Wu authored and David S. Miller committed Jul 29, 2015
1 parent 6d85d0e commit a04c0ae
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit a04c0ae

Please sign in to comment.