linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] bus: ti-sysc: Use PTR_ERR_OR_ZERO in sysc_init_resets()
@ 2019-04-11  2:47 YueHaibing
  2019-04-12 15:43 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2019-04-11  2:47 UTC (permalink / raw)
  To: Faiz Abbas, Tony Lindgren, Rob Herring
  Cc: YueHaibing, linux-kernel, kernel-janitors

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/bus/ti-sysc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index b696f26a3894..2b93be2882f3 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -432,10 +432,7 @@ static int sysc_init_resets(struct sysc *ddata)
 {
 	ddata->rsts =
 		devm_reset_control_array_get_optional_exclusive(ddata->dev);
-	if (IS_ERR(ddata->rsts))
-		return PTR_ERR(ddata->rsts);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(ddata->rsts);
 }
 
 /**






^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] bus: ti-sysc: Use PTR_ERR_OR_ZERO in sysc_init_resets()
  2019-04-11  2:47 [PATCH -next] bus: ti-sysc: Use PTR_ERR_OR_ZERO in sysc_init_resets() YueHaibing
@ 2019-04-12 15:43 ` Tony Lindgren
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2019-04-12 15:43 UTC (permalink / raw)
  To: YueHaibing; +Cc: Faiz Abbas, Rob Herring, linux-kernel, kernel-janitors

* YueHaibing <yuehaibing@huawei.com> [190411 02:36]:
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Thanks but I'll rather skip this one as I find it a bit hard
to read unless there's some reasoning other than compress
few lines out of the code.

Regards,

TOny

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-12 15:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-11  2:47 [PATCH -next] bus: ti-sysc: Use PTR_ERR_OR_ZERO in sysc_init_resets() YueHaibing
2019-04-12 15:43 ` Tony Lindgren

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).