All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Zou <zou_wei@huawei.com>
To: <davem@davemloft.net>
Cc: <grygorii.strashko@ti.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, Samuel Zou <zou_wei@huawei.com>
Subject: [PATCH -next] net: ethernet: ti: Use PTR_ERR_OR_ZERO() to simplify code
Date: Wed, 6 May 2020 10:54:58 +0800	[thread overview]
Message-ID: <1588733698-33746-1-git-send-email-zou_wei@huawei.com> (raw)

Fixes coccicheck warning:

drivers/net/ethernet/ti/am65-cpts.c:1017:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Samuel Zou <zou_wei@huawei.com>
---
 drivers/net/ethernet/ti/am65-cpts.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/ti/am65-cpts.c b/drivers/net/ethernet/ti/am65-cpts.c
index 370162c..51c94b2 100644
--- a/drivers/net/ethernet/ti/am65-cpts.c
+++ b/drivers/net/ethernet/ti/am65-cpts.c
@@ -1014,10 +1014,7 @@ static int am65_cpts_probe(struct platform_device *pdev)
 		return PTR_ERR(base);
 
 	cpts = am65_cpts_create(dev, base, node);
-	if (IS_ERR(cpts))
-		return PTR_ERR(cpts);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(cpts);
 }
 
 static const struct of_device_id am65_cpts_of_match[] = {
-- 
2.6.2


             reply	other threads:[~2020-05-06  2:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06  2:54 Samuel Zou [this message]
2020-05-06 20:44 ` [PATCH -next] net: ethernet: ti: Use PTR_ERR_OR_ZERO() to simplify code 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=1588733698-33746-1-git-send-email-zou_wei@huawei.com \
    --to=zou_wei@huawei.com \
    --cc=davem@davemloft.net \
    --cc=grygorii.strashko@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.