linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/sun4i: use PTR_ERR_OR_ZERO macro.
@ 2020-01-06 14:00 Wambui Karuga
  2020-01-07 11:57 ` Maxime Ripard
  0 siblings, 1 reply; 3+ messages in thread
From: Wambui Karuga @ 2020-01-06 14:00 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel; +Cc: dri-devel, linux-arm-kernel, linux-kernel

Replace the use of IS_ERR and PTR_ZERO macros by returning the
PTR_ERR_OR_ZERO macro.
Changes suggested by coccinelle. 

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/sun4i/sun4i_dotclock.c     | 4 +---
 drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c | 4 +---
 drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c     | 4 +---
 drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c | 4 +---
 4 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
index 417ade3d2565..84c04d8192b3 100644
--- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c
+++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
@@ -191,10 +191,8 @@ int sun4i_dclk_create(struct device *dev, struct sun4i_tcon *tcon)
 	dclk->hw.init = &init;
 
 	tcon->dclk = clk_register(dev, &dclk->hw);
-	if (IS_ERR(tcon->dclk))
-		return PTR_ERR(tcon->dclk);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(tcon->dclk);
 }
 EXPORT_SYMBOL(sun4i_dclk_create);
 
diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
index 2ff780114106..7a59505d6907 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
@@ -135,8 +135,6 @@ int sun4i_ddc_create(struct sun4i_hdmi *hdmi, struct clk *parent)
 	ddc->m_offset = hdmi->variant->ddc_clk_m_offset;
 
 	hdmi->ddc_clk = devm_clk_register(hdmi->dev, &ddc->hw);
-	if (IS_ERR(hdmi->ddc_clk))
-		return PTR_ERR(hdmi->ddc_clk);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(hdmi->ddc_clk);
 }
diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
index b66fa27fe6ea..12a7b7b1c99c 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
@@ -278,10 +278,8 @@ static int sun4i_hdmi_init_regmap_fields(struct sun4i_hdmi *hdmi)
 	hdmi->field_ddc_sck_en =
 		devm_regmap_field_alloc(hdmi->dev, hdmi->regmap,
 					hdmi->variant->field_ddc_sck_en);
-	if (IS_ERR(hdmi->field_ddc_sck_en))
-		return PTR_ERR(hdmi->field_ddc_sck_en);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(hdmi->field_ddc_sck_en);
 }
 
 int sun4i_hdmi_i2c_create(struct device *dev, struct sun4i_hdmi *hdmi)
diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
index a4d31fe3abff..fd09eff21b25 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.17.1


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

* Re: [PATCH] drm/sun4i: use PTR_ERR_OR_ZERO macro.
  2020-01-06 14:00 [PATCH] drm/sun4i: use PTR_ERR_OR_ZERO macro Wambui Karuga
@ 2020-01-07 11:57 ` Maxime Ripard
  2020-01-07 12:45   ` Wambui Karuga
  0 siblings, 1 reply; 3+ messages in thread
From: Maxime Ripard @ 2020-01-07 11:57 UTC (permalink / raw)
  To: Wambui Karuga
  Cc: wens, airlied, daniel, dri-devel, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 491 bytes --]

Hi,

On Mon, Jan 06, 2020 at 05:00:52PM +0300, Wambui Karuga wrote:
> Replace the use of IS_ERR and PTR_ZERO macros by returning the
> PTR_ERR_OR_ZERO macro.
> Changes suggested by coccinelle.
>
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>

Unfortunately, that patch came up a number of time and shouldn't have
been a coccinelle script in the first place.

I've sent a patch to remove that script:
https://lore.kernel.org/lkml/20200107073629.325249-1-maxime@cerno.tech/

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH] drm/sun4i: use PTR_ERR_OR_ZERO macro.
  2020-01-07 11:57 ` Maxime Ripard
@ 2020-01-07 12:45   ` Wambui Karuga
  0 siblings, 0 replies; 3+ messages in thread
From: Wambui Karuga @ 2020-01-07 12:45 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Wambui Karuga, wens, airlied, daniel, dri-devel,
	linux-arm-kernel, linux-kernel



On Tue, 7 Jan 2020, Maxime Ripard wrote:

> Hi,
>
> On Mon, Jan 06, 2020 at 05:00:52PM +0300, Wambui Karuga wrote:
>> Replace the use of IS_ERR and PTR_ZERO macros by returning the
>> PTR_ERR_OR_ZERO macro.
>> Changes suggested by coccinelle.
>>
>> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
>
> Unfortunately, that patch came up a number of time and shouldn't have
> been a coccinelle script in the first place.
>
> I've sent a patch to remove that script:
> https://lore.kernel.org/lkml/20200107073629.325249-1-maxime@cerno.tech/
>
Okay, thanks for the review.
> Maxime
>

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

end of thread, other threads:[~2020-01-07 12:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06 14:00 [PATCH] drm/sun4i: use PTR_ERR_OR_ZERO macro Wambui Karuga
2020-01-07 11:57 ` Maxime Ripard
2020-01-07 12:45   ` Wambui Karuga

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