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

Message ID 6745733c.be.1844d54f4b9.Coremail.wangkailong@jari.cn
State New
Headers
Series mailbox: platform-mhu: Remove unnecessary print function dev_err() |

Commit Message

KaiLong Wang Nov. 6, 2022, 2:25 p.m. UTC
  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@jari.cn>
---
 drivers/mailbox/platform_mhu.c | 1 -
 1 file changed, 1 deletion(-)
  

Comments

Christophe JAILLET Nov. 6, 2022, 3:53 p.m. UTC | #1
Le 06/11/2022 à 15:25, wangkailong@jari.cn 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@jari.cn>
> ---
>   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];
  

Patch

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;
 		}
 		mhu->mlink[i].rx_reg = mhu->base + platform_mhu_reg[i];