[PATCH] USB: PHY: JZ4770: fix ptr_ret.cocci warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: kernel test robot <lkp@xxxxxxxxx>

drivers/phy/ingenic/phy-ingenic-usb.c:348: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

CC: 周琰杰 (Zhou Yanjie) <zhouyanjie@xxxxxxxxxxxxxx>
Signed-off-by: kernel test robot <lkp@xxxxxxxxx>
---

url:    https://github.com/0day-ci/linux/commits/Zhou-Yanjie/Use-the-generic-PHY-framework-for-Ingenic-USB-PHY/20200913-143611
base:   https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git testing/next

 phy-ingenic-usb.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/phy/ingenic/phy-ingenic-usb.c
+++ b/drivers/phy/ingenic/phy-ingenic-usb.c
@@ -345,10 +345,7 @@ static int ingenic_usb_phy_probe(struct
 	phy_set_drvdata(priv->phy, priv);
 
 	provider = devm_of_phy_provider_register(priv->dev, of_phy_simple_xlate);
-	if (IS_ERR(provider))
-		return PTR_ERR(provider);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(provider);
 }
 
 static const struct of_device_id ingenic_usb_phy_of_matches[] = {



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux