Skip to contentSkip to conversation

drm/sprd: remove redundant error logging

PATCH In review Deepak R Varma 3 participants 4 messages Dec 11, 2022 – Dec 22, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/sprd: remove redundant error logging

A call to platform_get_irq() already prints an error on failure within its own implementation. So printing another error based on its return value in the caller is redundant and should be removed. The clean up also makes if condition block braces unnecessary. Remove that as well.

Issue identified using platform_get_irq.cocci coccicheck script.

---
 drivers/gpu/drm/sprd/sprd_dpu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/sprd/sprd_dpu.c +1 -3
index 88f4259680f1..db0bcea1d9f4 100644
@@ -803,10 +803,8 @@ static int sprd_dpu_context_init(struct sprd_dpu *dpu,
 	}
 
 	ctx->irq = platform_get_irq(pdev, 0);
-	if (ctx->irq < 0) {
-		dev_err(dev, "failed to get dpu irq\n");
+	if (ctx->irq < 0)
 		return ctx->irq;
-	}
 
 	/* disable and clear interrupts before register dpu IRQ. */
 	writel(0x00, ctx->base + REG_DPU_INT_EN);

--
2.34.1

#1 lore raw

On Sun, Dec 11, 2022 at 07:25:08PM +0530, Deepak R Varma wrote:

Hello,
May I please request a review and feedback on this patch proposal?

Thank you,
./drv

Quoted 31 lines

A call to platform_get_irq() already prints an error on failure within its own implementation. So printing another error based on its return value in the caller is redundant and should be removed. The clean up also makes if condition block braces unnecessary. Remove that as well.

Issue identified using platform_get_irq.cocci coccicheck script.

---
 drivers/gpu/drm/sprd/sprd_dpu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/sprd/sprd_dpu.c +1 -4
index 88f4259680f1..db0bcea1d9f4 100644
@@ -803,10 +803,8 @@ static int sprd_dpu_context_init(struct sprd_dpu *dpu,
 	}
 
 	ctx->irq = platform_get_irq(pdev, 0);
-	if (ctx->irq < 0) {
-		dev_err(dev, "failed to get dpu irq\n");
+	if (ctx->irq < 0)
 		return ctx->irq;
-	}
 
 	/* disable and clear interrupts before register dpu IRQ. */
 	writel(0x00, ctx->base + REG_DPU_INT_EN);
--

2.34.1

#2 lore raw

Hi

Am 19.12.22 um 21:55 schrieb Deepak R Varma:

Quoted 4 lines · Deepak R Varma

Hello,
May I please request a review and feedback on this patch proposal?

Added to drm-misc-next. Thanks for the patch.

Best regards
Thomas

Quoted 37 lines

Thank you,
./drv

Quoted 31 lines

A call to platform_get_irq() already prints an error on failure within its own implementation. So printing another error based on its return value in the caller is redundant and should be removed. The clean up also makes if condition block braces unnecessary. Remove that as well.

Issue identified using platform_get_irq.cocci coccicheck script.

---
  drivers/gpu/drm/sprd/sprd_dpu.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/sprd/sprd_dpu.c +1 -4
index 88f4259680f1..db0bcea1d9f4 100644
@@ -803,10 +803,8 @@ static int sprd_dpu_context_init(struct sprd_dpu *dpu,
  	}
 
  	ctx->irq = platform_get_irq(pdev, 0);
-	if (ctx->irq < 0) {
-		dev_err(dev, "failed to get dpu irq\n");
+	if (ctx->irq < 0)
  		return ctx->irq;
-	}
 
  	/* disable and clear interrupts before register dpu IRQ. */
  	writel(0x00, ctx->base + REG_DPU_INT_EN);
--

2.34.1

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
reviewer Acked-by on v1 1/1
#3 lore raw
In reply to Deepak R Varma
Quoted 18 lines · Deepak R Varma

A call to platform_get_irq() already prints an error on failure within its own implementation. So printing another error based on its return value in the caller is redundant and should be removed. The clean up also makes if condition block braces unnecessary. Remove that as well.

Issue identified using platform_get_irq.cocci coccicheck script.

---
 drivers/gpu/drm/sprd/sprd_dpu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/sprd/sprd_dpu.c +0 -0
index 88f4259680f1..db0bcea1d9f4 100644

drivers/gpu/drm/sprd/sprd_dpu.c static int sprd_dpu_context_init(struct sprd_dpu *dpu, · line 806

Quoted 6 lines
drivers/gpu/drm/sprd/sprd_dpu.c +1 -2
@@ -803,10 +803,8 @@ static int sprd_dpu_context_init(struct sprd_dpu *dpu,
        }
 
        ctx->irq = platform_get_irq(pdev, 0);
-       if (ctx->irq < 0) {
-               dev_err(dev, "failed to get dpu irq\n");
+       if (ctx->irq < 0)

Thanks for the patch, it makes sense to me, so

Quoted 10 lines
drivers/gpu/drm/sprd/sprd_dpu.c +0 -2
                return ctx->irq;
-       }
 
        /* disable and clear interrupts before register dpu IRQ. */
        writel(0x00, ctx->base + REG_DPU_INT_EN);
--

2.34.1