Skip to contentSkip to conversation

drm: Remove unnecessary print function dev_err()

PATCH In review Yang Li 2 participants 2 messages Jun 24, 2022 – Jun 26, 2022

Subsystems (3)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 drm: Remove unnecessary print function dev_err()

The print function dev_err() is redundant because platform_get_irq() already prints an error.

Eliminate the follow coccicheck warning:
./drivers/gpu/drm/sprd/sprd_dpu.c:808:2-9: line 808 is redundant because platform_get_irq() already prints an error

---
 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 3664089b6983..de4848dc0d22 100644
@@ -804,10 +804,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);
Signature · 1 line
2.20.1.7.g153144c
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Yang Li

The print function dev_err() is redundant because platform_get_irq() already prints an error.

Eliminate the follow coccicheck warning:
./drivers/gpu/drm/sprd/sprd_dpu.c:808:2-9: line 808 is redundant because platform_get_irq() already prints an error

Quoted 23 lines
---
 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 3664089b6983..de4848dc0d22 100644
@@ -804,10 +804,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.20.1.7.g153144c