* [PATCH] net: ethernet: ti: Use ERR_CAST instead of ERR_PTR(PTR_ERR())
@ 2018-05-13 23:33 Hernán Gonzalez
2018-05-14 20:28 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Hernán Gonzalez @ 2018-05-13 23:33 UTC (permalink / raw)
To: davem
Cc: grygorii.strashko, richardcochran, netdev, linux-kernel,
Hernán Gonzalez
Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)).
drivers/net/ethernet/ti/cpts.c:567:9-16: WARNING: ERR_CAST can be used with cpts->refclk
Generated by: scripts/coccinelle/api/err_cast.cocci
Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
---
drivers/net/ethernet/ti/cpts.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
index e7b76f6..7842f09 100644
--- a/drivers/net/ethernet/ti/cpts.c
+++ b/drivers/net/ethernet/ti/cpts.c
@@ -564,7 +564,7 @@ struct cpts *cpts_create(struct device *dev, void __iomem *regs,
cpts->refclk = devm_clk_get(dev, "cpts");
if (IS_ERR(cpts->refclk)) {
dev_err(dev, "Failed to get cpts refclk\n");
- return ERR_PTR(PTR_ERR(cpts->refclk));
+ return ERR_CAST(cpts->refclk);
}
clk_prepare(cpts->refclk);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: ethernet: ti: Use ERR_CAST instead of ERR_PTR(PTR_ERR())
2018-05-13 23:33 [PATCH] net: ethernet: ti: Use ERR_CAST instead of ERR_PTR(PTR_ERR()) Hernán Gonzalez
@ 2018-05-14 20:28 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-05-14 20:28 UTC (permalink / raw)
To: hernan; +Cc: grygorii.strashko, richardcochran, netdev, linux-kernel
From: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
Date: Sun, 13 May 2018 20:33:49 -0300
> Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)).
>
> drivers/net/ethernet/ti/cpts.c:567:9-16: WARNING: ERR_CAST can be used with cpts->refclk
> Generated by: scripts/coccinelle/api/err_cast.cocci
>
> Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
Applied to net-next, thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-05-14 20:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-13 23:33 [PATCH] net: ethernet: ti: Use ERR_CAST instead of ERR_PTR(PTR_ERR()) Hernán Gonzalez
2018-05-14 20:28 ` David Miller
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).