All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH-next] drm/sun4i: Use PTR_ERR_OR_ZERO in sun8i_phy_clk_create()
@ 2019-02-03  0:06 ` Christopher Diaz Riveros
  0 siblings, 0 replies; 4+ messages in thread
From: Christopher Diaz Riveros @ 2019-02-03  0:06 UTC (permalink / raw)
  To: airlied, daniel, wens
  Cc: Christopher Diaz Riveros, linux-arm-kernel, linux-kernel

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

Signed-off-by: Christopher Diaz Riveros <chrisadr@gentoo.org>
---
 drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
index a4d31fe3abff..d52f581797f0 100644
--- a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
+++ b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
@@ -171,8 +171,6 @@ int sun8i_phy_clk_create(struct sun8i_hdmi_phy *phy, struct device *dev,
 	priv->hw.init = &init;
 
 	phy->clk_phy = devm_clk_register(dev, &priv->hw);
-	if (IS_ERR(phy->clk_phy))
-		return PTR_ERR(phy->clk_phy);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(phy->clk_phy);
 }
-- 
2.20.1


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

* [PATCH-next] drm/sun4i: Use PTR_ERR_OR_ZERO in sun8i_phy_clk_create()
@ 2019-02-03  0:06 ` Christopher Diaz Riveros
  0 siblings, 0 replies; 4+ messages in thread
From: Christopher Diaz Riveros @ 2019-02-03  0:06 UTC (permalink / raw)
  To: airlied, daniel, wens
  Cc: Christopher Diaz Riveros, linux-kernel, linux-arm-kernel

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

Signed-off-by: Christopher Diaz Riveros <chrisadr@gentoo.org>
---
 drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
index a4d31fe3abff..d52f581797f0 100644
--- a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
+++ b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
@@ -171,8 +171,6 @@ int sun8i_phy_clk_create(struct sun8i_hdmi_phy *phy, struct device *dev,
 	priv->hw.init = &init;
 
 	phy->clk_phy = devm_clk_register(dev, &priv->hw);
-	if (IS_ERR(phy->clk_phy))
-		return PTR_ERR(phy->clk_phy);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(phy->clk_phy);
 }
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH-next] drm/sun4i: Use PTR_ERR_OR_ZERO in sun8i_phy_clk_create()
  2019-02-03  0:06 ` Christopher Diaz Riveros
@ 2019-02-05 15:08   ` Chen-Yu Tsai
  -1 siblings, 0 replies; 4+ messages in thread
From: Chen-Yu Tsai @ 2019-02-05 15:08 UTC (permalink / raw)
  To: Christopher Diaz Riveros
  Cc: David Airlie, Daniel Vetter, linux-kernel, linux-arm-kernel

On Sun, Feb 3, 2019 at 8:07 AM Christopher Diaz Riveros
<chrisadr@gentoo.org> wrote:
>
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Maxime's reply to the patch "drm/sun4i: hdmi: Use PTR_ERR_OR_ZERO
in sun4i_tmds_create()" [1] probably applies to this one as well:

"""
While this is technically correct (and I appreciate that this is also
a matter of taste), I find the former syntax to be clearer and easier
to extend if needed.
"""

ChenYu

[1] https://patchwork.kernel.org/patch/10671757/

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

* Re: [PATCH-next] drm/sun4i: Use PTR_ERR_OR_ZERO in sun8i_phy_clk_create()
@ 2019-02-05 15:08   ` Chen-Yu Tsai
  0 siblings, 0 replies; 4+ messages in thread
From: Chen-Yu Tsai @ 2019-02-05 15:08 UTC (permalink / raw)
  To: Christopher Diaz Riveros
  Cc: David Airlie, linux-kernel, Daniel Vetter, linux-arm-kernel

On Sun, Feb 3, 2019 at 8:07 AM Christopher Diaz Riveros
<chrisadr@gentoo.org> wrote:
>
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Maxime's reply to the patch "drm/sun4i: hdmi: Use PTR_ERR_OR_ZERO
in sun4i_tmds_create()" [1] probably applies to this one as well:

"""
While this is technically correct (and I appreciate that this is also
a matter of taste), I find the former syntax to be clearer and easier
to extend if needed.
"""

ChenYu

[1] https://patchwork.kernel.org/patch/10671757/

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-02-05 15:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-03  0:06 [PATCH-next] drm/sun4i: Use PTR_ERR_OR_ZERO in sun8i_phy_clk_create() Christopher Diaz Riveros
2019-02-03  0:06 ` Christopher Diaz Riveros
2019-02-05 15:08 ` Chen-Yu Tsai
2019-02-05 15:08   ` Chen-Yu Tsai

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.