Re: [PATCH] mailbox: platform-mhu: Remove unnecessary print function dev_err()

From: Christophe JAILLET
Date: Sun Nov 06 2022 - 10:53:33 EST


Le 06/11/2022 à 15:25, wangkailong@xxxxxxx a écrit :
Eliminate the follow coccicheck warning:

./drivers/mailbox/platform_mhu.c:139:3-10: line 139 is redundant because
platform_get_irq() already prints an error

Signed-off-by: KaiLong Wang <wangkailong@xxxxxxx>
---
drivers/mailbox/platform_mhu.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/mailbox/platform_mhu.c b/drivers/mailbox/platform_mhu.c
index a5922ac0b0bf..08e0eedea860 100644
--- a/drivers/mailbox/platform_mhu.c
+++ b/drivers/mailbox/platform_mhu.c
@@ -136,7 +136,6 @@ static int platform_mhu_probe(struct platform_device *pdev)
mhu->chan[i].con_priv = &mhu->mlink[i];
mhu->mlink[i].irq = platform_get_irq(pdev, i);
if (mhu->mlink[i].irq < 0) {
- dev_err(dev, "failed to get irq%d\n", i);
return mhu->mlink[i].irq;
}

Hi,

apparently, you sent several patches like this one.

When doing such cleanups, you should also remove the now useless { } when there is just one statement left, after the "if".

CJ

mhu->mlink[i].rx_reg = mhu->base + platform_mhu_reg[i];