* [PATCH -next] net: ethernet: ti: Use PTR_ERR_OR_ZERO() to simplify code
@ 2020-05-06 2:54 Samuel Zou
2020-05-06 20:44 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Samuel Zou @ 2020-05-06 2:54 UTC (permalink / raw)
To: davem; +Cc: grygorii.strashko, netdev, linux-kernel, Samuel Zou
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] net: ethernet: ti: Use PTR_ERR_OR_ZERO() to simplify code
2020-05-06 2:54 [PATCH -next] net: ethernet: ti: Use PTR_ERR_OR_ZERO() to simplify code Samuel Zou
@ 2020-05-06 20:44 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-06 20:44 UTC (permalink / raw)
To: zou_wei; +Cc: grygorii.strashko, netdev, linux-kernel
From: Samuel Zou <zou_wei@huawei.com>
Date: Wed, 6 May 2020 10:54:58 +0800
> 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>
Applied to net-next, thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-06 20:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-06 2:54 [PATCH -next] net: ethernet: ti: Use PTR_ERR_OR_ZERO() to simplify code Samuel Zou
2020-05-06 20:44 ` David Miller
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.