Skip to content

Commit

Permalink
net: phy: mscc: fix ptr_ret.cocci warnings
Browse files Browse the repository at this point in the history
drivers/net/phy/mscc/mscc_ptp.c:1496: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

Fixes: 7d272e6 ("net: phy: mscc: timestamping and PHC support")
CC: Antoine Tenart <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
intel-lab-lkp authored and davem330 committed Jul 9, 2020
1 parent e3cbdaf commit faea30e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/net/phy/mscc/mscc_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1494,10 +1494,7 @@ static int __vsc8584_init_ptp(struct phy_device *phydev)

vsc8531->ptp->ptp_clock = ptp_clock_register(&vsc8531->ptp->caps,
&phydev->mdio.dev);
if (IS_ERR(vsc8531->ptp->ptp_clock))
return PTR_ERR(vsc8531->ptp->ptp_clock);

return 0;
return PTR_ERR_OR_ZERO(vsc8531->ptp->ptp_clock);
}

void vsc8584_config_ts_intr(struct phy_device *phydev)
Expand Down

0 comments on commit faea30e

Please sign in to comment.