lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1588733698-33746-1-git-send-email-zou_wei@huawei.com>
Date:   Wed, 6 May 2020 10:54:58 +0800
From:   Samuel Zou <zou_wei@...wei.com>
To:     <davem@...emloft.net>
CC:     <grygorii.strashko@...com>, <netdev@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, Samuel Zou <zou_wei@...wei.com>
Subject: [PATCH -next] net: ethernet: ti: Use PTR_ERR_OR_ZERO() to simplify code

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@...wei.com>
Signed-off-by: Samuel Zou <zou_wei@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ