All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code
@ 2019-11-18 12:34 ` zhengbin
  0 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

zhengbin (5):
  drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in
    sun4i_hdmi_init_regmap_fields
  drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_tmds_create
  drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_dclk_create
  drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_ddc_create
  drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in
    sun8i_phy_clk_create

 drivers/gpu/drm/sun4i/sun4i_dotclock.c      | 5 +----
 drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c  | 5 +----
 drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c      | 5 +----
 drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c | 5 +----
 drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c  | 5 +----
 5 files changed, 5 insertions(+), 20 deletions(-)

--
2.7.4


_______________________________________________
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] 20+ messages in thread

* [PATCH 0/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code
@ 2019-11-18 12:34 ` zhengbin
  0 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

zhengbin (5):
  drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in
    sun4i_hdmi_init_regmap_fields
  drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_tmds_create
  drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_dclk_create
  drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_ddc_create
  drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in
    sun8i_phy_clk_create

 drivers/gpu/drm/sun4i/sun4i_dotclock.c      | 5 +----
 drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c  | 5 +----
 drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c      | 5 +----
 drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c | 5 +----
 drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c  | 5 +----
 5 files changed, 5 insertions(+), 20 deletions(-)

--
2.7.4

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

* [PATCH 0/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code
@ 2019-11-18 12:34 ` zhengbin
  0 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

zhengbin (5):
  drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in
    sun4i_hdmi_init_regmap_fields
  drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_tmds_create
  drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_dclk_create
  drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_ddc_create
  drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in
    sun8i_phy_clk_create

 drivers/gpu/drm/sun4i/sun4i_dotclock.c      | 5 +----
 drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c  | 5 +----
 drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c      | 5 +----
 drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c | 5 +----
 drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c  | 5 +----
 5 files changed, 5 insertions(+), 20 deletions(-)

--
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 1/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_hdmi_init_regmap_fields
  2019-11-18 12:34 ` zhengbin
  (?)
@ 2019-11-18 12:34   ` zhengbin
  -1 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c:281:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
index b66fa27..ac435e5 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
@@ -278,10 +278,7 @@ 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)
--
2.7.4


_______________________________________________
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] 20+ messages in thread

* [PATCH 1/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_hdmi_init_regmap_fields
@ 2019-11-18 12:34   ` zhengbin
  0 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c:281:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
index b66fa27..ac435e5 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
@@ -278,10 +278,7 @@ 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)
--
2.7.4

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

* [PATCH 1/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_hdmi_init_regmap_fields
@ 2019-11-18 12:34   ` zhengbin
  0 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c:281:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
index b66fa27..ac435e5 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
@@ -278,10 +278,7 @@ 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)
--
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 2/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_tmds_create
  2019-11-18 12:34 ` zhengbin
  (?)
@ 2019-11-18 12:34   ` zhengbin
  -1 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c:232:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
index fbf7da9..c90dd0a 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
@@ -229,8 +229,5 @@ int sun4i_tmds_create(struct sun4i_hdmi *hdmi)
 	tmds->div_offset = hdmi->variant->tmds_clk_div_offset;

 	hdmi->tmds_clk = devm_clk_register(hdmi->dev, &tmds->hw);
-	if (IS_ERR(hdmi->tmds_clk))
-		return PTR_ERR(hdmi->tmds_clk);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(hdmi->tmds_clk);
 }
--
2.7.4


_______________________________________________
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] 20+ messages in thread

* [PATCH 2/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_tmds_create
@ 2019-11-18 12:34   ` zhengbin
  0 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c:232:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
index fbf7da9..c90dd0a 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
@@ -229,8 +229,5 @@ int sun4i_tmds_create(struct sun4i_hdmi *hdmi)
 	tmds->div_offset = hdmi->variant->tmds_clk_div_offset;

 	hdmi->tmds_clk = devm_clk_register(hdmi->dev, &tmds->hw);
-	if (IS_ERR(hdmi->tmds_clk))
-		return PTR_ERR(hdmi->tmds_clk);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(hdmi->tmds_clk);
 }
--
2.7.4

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

* [PATCH 2/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_tmds_create
@ 2019-11-18 12:34   ` zhengbin
  0 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c:232:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
index fbf7da9..c90dd0a 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
@@ -229,8 +229,5 @@ int sun4i_tmds_create(struct sun4i_hdmi *hdmi)
 	tmds->div_offset = hdmi->variant->tmds_clk_div_offset;

 	hdmi->tmds_clk = devm_clk_register(hdmi->dev, &tmds->hw);
-	if (IS_ERR(hdmi->tmds_clk))
-		return PTR_ERR(hdmi->tmds_clk);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(hdmi->tmds_clk);
 }
--
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 3/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_dclk_create
  2019-11-18 12:34 ` zhengbin
  (?)
@ 2019-11-18 12:34   ` zhengbin
  -1 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun4i_dotclock.c:194:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpu/drm/sun4i/sun4i_dotclock.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
index 417ade3d..b4db36c 100644
--- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c
+++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
@@ -191,10 +191,7 @@ 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);

--
2.7.4


_______________________________________________
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] 20+ messages in thread

* [PATCH 3/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_dclk_create
@ 2019-11-18 12:34   ` zhengbin
  0 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun4i_dotclock.c:194:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpu/drm/sun4i/sun4i_dotclock.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
index 417ade3d..b4db36c 100644
--- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c
+++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
@@ -191,10 +191,7 @@ 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);

--
2.7.4

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

* [PATCH 3/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_dclk_create
@ 2019-11-18 12:34   ` zhengbin
  0 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun4i_dotclock.c:194:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpu/drm/sun4i/sun4i_dotclock.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
index 417ade3d..b4db36c 100644
--- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c
+++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
@@ -191,10 +191,7 @@ 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);

--
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 4/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_ddc_create
  2019-11-18 12:34 ` zhengbin
  (?)
@ 2019-11-18 12:34   ` zhengbin
  -1 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c:138:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
index 2ff7801..cf7e442 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
@@ -135,8 +135,5 @@ 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);
 }
--
2.7.4


_______________________________________________
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] 20+ messages in thread

* [PATCH 4/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_ddc_create
@ 2019-11-18 12:34   ` zhengbin
  0 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c:138:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
index 2ff7801..cf7e442 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
@@ -135,8 +135,5 @@ 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);
 }
--
2.7.4

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

* [PATCH 4/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_ddc_create
@ 2019-11-18 12:34   ` zhengbin
  0 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c:138:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
index 2ff7801..cf7e442 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
@@ -135,8 +135,5 @@ 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);
 }
--
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 5/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun8i_phy_clk_create
  2019-11-18 12:34 ` zhengbin
  (?)
@ 2019-11-18 12:34   ` zhengbin
  -1 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c:174:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
index a4d31fe..fb0d77d 100644
--- a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
+++ b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
@@ -171,8 +171,5 @@ 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.7.4


_______________________________________________
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] 20+ messages in thread

* [PATCH 5/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun8i_phy_clk_create
@ 2019-11-18 12:34   ` zhengbin
  0 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c:174:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
index a4d31fe..fb0d77d 100644
--- a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
+++ b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
@@ -171,8 +171,5 @@ 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.7.4

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

* [PATCH 5/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun8i_phy_clk_create
@ 2019-11-18 12:34   ` zhengbin
  0 siblings, 0 replies; 20+ messages in thread
From: zhengbin @ 2019-11-18 12:34 UTC (permalink / raw)
  To: mripard, wens, airlied, daniel, dri-devel, linux-arm-kernel; +Cc: zhengbin13

Fixes coccicheck warning:

drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c:174:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
index a4d31fe..fb0d77d 100644
--- a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
+++ b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c
@@ -171,8 +171,5 @@ 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.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 1/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_hdmi_init_regmap_fields
@ 2019-11-18 13:00     ` Maxime Ripard
  0 siblings, 0 replies; 20+ messages in thread
From: Maxime Ripard @ 2019-11-18 13:00 UTC (permalink / raw)
  To: zhengbin; +Cc: airlied, wens, dri-devel, daniel, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1160 bytes --]

On Mon, Nov 18, 2019 at 08:34:40PM +0800, zhengbin wrote:
> Fixes coccicheck warning:
>
> drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c:281:1-3: WARNING: PTR_ERR_OR_ZERO can be used
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
>  drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
> index b66fa27..ac435e5 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
> @@ -278,10 +278,7 @@ 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);

These 5 patches are not clearer and just make it more difficult to
maintain. I guess we should just get rid of the coccinelle rule here,
there's a lot of false positive with it.

Maxime

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

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
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] 20+ messages in thread

* Re: [PATCH 1/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_hdmi_init_regmap_fields
@ 2019-11-18 13:00     ` Maxime Ripard
  0 siblings, 0 replies; 20+ messages in thread
From: Maxime Ripard @ 2019-11-18 13:00 UTC (permalink / raw)
  To: zhengbin; +Cc: airlied, wens, dri-devel, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1160 bytes --]

On Mon, Nov 18, 2019 at 08:34:40PM +0800, zhengbin wrote:
> Fixes coccicheck warning:
>
> drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c:281:1-3: WARNING: PTR_ERR_OR_ZERO can be used
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
>  drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
> index b66fa27..ac435e5 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c
> @@ -278,10 +278,7 @@ 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);

These 5 patches are not clearer and just make it more difficult to
maintain. I guess we should just get rid of the coccinelle rule here,
there's a lot of false positive with it.

Maxime

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

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2019-11-19  8:06 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-18 12:34 [PATCH 0/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code zhengbin
2019-11-18 12:34 ` zhengbin
2019-11-18 12:34 ` zhengbin
2019-11-18 12:34 ` [PATCH 1/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_hdmi_init_regmap_fields zhengbin
2019-11-18 12:34   ` zhengbin
2019-11-18 12:34   ` zhengbin
2019-11-18 13:00   ` Maxime Ripard
2019-11-18 13:00     ` Maxime Ripard
2019-11-18 12:34 ` [PATCH 2/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_tmds_create zhengbin
2019-11-18 12:34   ` zhengbin
2019-11-18 12:34   ` zhengbin
2019-11-18 12:34 ` [PATCH 3/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_dclk_create zhengbin
2019-11-18 12:34   ` zhengbin
2019-11-18 12:34   ` zhengbin
2019-11-18 12:34 ` [PATCH 4/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun4i_ddc_create zhengbin
2019-11-18 12:34   ` zhengbin
2019-11-18 12:34   ` zhengbin
2019-11-18 12:34 ` [PATCH 5/5] drm/sun4i: Use PTR_ERR_OR_ZERO() to simplify code in sun8i_phy_clk_create zhengbin
2019-11-18 12:34   ` zhengbin
2019-11-18 12:34   ` zhengbin

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.