Skip to content

Commit faea30e

Browse files
intel-lab-lkpdavem330
authored andcommitted
net: phy: mscc: fix ptr_ret.cocci warnings
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 <antoine.tenart@bootlin.com> Signed-off-by: kernel test robot <lkp@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e3cbdaf commit faea30e

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎drivers/net/phy/mscc/mscc_ptp.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,10 +1494,7 @@ static int __vsc8584_init_ptp(struct phy_device *phydev)
14941494

14951495
vsc8531->ptp->ptp_clock = ptp_clock_register(&vsc8531->ptp->caps,
14961496
&phydev->mdio.dev);
1497-
if (IS_ERR(vsc8531->ptp->ptp_clock))
1498-
return PTR_ERR(vsc8531->ptp->ptp_clock);
1499-
1500-
return 0;
1497+
return PTR_ERR_OR_ZERO(vsc8531->ptp->ptp_clock);
15011498
}
15021499

15031500
void vsc8584_config_ts_intr(struct phy_device *phydev)

0 commit comments

Comments
 (0)