netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Antoine Tenart <antoine.tenart@bootlin.com>
Cc: kbuild-all@lists.01.org,
	Quentin Schulz <quentin.schulz@bootlin.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] net: phy: mscc: fix ptr_ret.cocci warnings
Date: Fri, 26 Jun 2020 09:05:18 +0800	[thread overview]
Message-ID: <20200626010518.GA6037@890dc296aae1> (raw)
In-Reply-To: <202006260959.QkSmCdSE%lkp@intel.com>

From: kernel test robot <lkp@intel.com>

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: 7d272e63e097 ("net: phy: mscc: timestamping and PHC support")
CC: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   3f9437c6234d95d96967f1b438a4fb71b6be254d
commit: 7d272e63e0979d38a6256108adbe462d621c26c5 [3775/3988] net: phy: mscc: timestamping and PHC support

 mscc_ptp.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/net/phy/mscc/mscc_ptp.c
+++ b/drivers/net/phy/mscc/mscc_ptp.c
@@ -1493,10 +1493,7 @@ static int __vsc8584_init_ptp(struct phy
 
 	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)

       reply	other threads:[~2020-06-26  1:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <202006260959.QkSmCdSE%lkp@intel.com>
2020-06-26  1:05 ` kernel test robot [this message]
     [not found] <202007100043.AqyWtI2n%lkp@intel.com>
2020-07-09 16:06 ` [PATCH] net: phy: mscc: fix ptr_ret.cocci warnings kernel test robot
2020-07-09 20:10   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200626010518.GA6037@890dc296aae1 \
    --to=lkp@intel.com \
    --cc=andrew@lunn.ch \
    --cc=antoine.tenart@bootlin.com \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=quentin.schulz@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).