Skip to contentSkip to conversation

mailbox: platform-mhu: Remove unnecessary print function dev_err()

PATCH In review [email protected] 2 participants 2 messages Nov 6, 2022 Mailbox API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mailbox: platform-mhu: Remove unnecessary print function dev_err()

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

---
 drivers/mailbox/platform_mhu.c | 1 -
 1 file changed, 1 deletion(-)
drivers/mailbox/platform_mhu.c +0 -1
index a5922ac0b0bf..08e0eedea860 100644
@@ -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;
 		}
 		mhu->mlink[i].rx_reg = mhu->base + platform_mhu_reg[i];
Signature · 1 line
2.25.1
#1 lore raw

Le 06/11/2022 à 15:25, [email protected] a écrit :

Quoted 15 lines

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

---
  drivers/mailbox/platform_mhu.c | 1 -
  1 file changed, 1 deletion(-)
drivers/mailbox/platform_mhu.c +0 -0
index a5922ac0b0bf..08e0eedea860 100644

drivers/mailbox/platform_mhu.c static int platform_mhu_probe(struct platform_device *pdev) · line 140

Quoted 6 lines
drivers/mailbox/platform_mhu.c +0 -1
@@ -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

Quoted 1 line
drivers/mailbox/platform_mhu.c +0 -0
  		mhu->mlink[i].rx_reg = mhu->base + platform_mhu_reg[i];