linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] edac: remove redundant error print in xgene_edac_probe
@ 2021-01-12  8:46 menglong8.dong
  2021-01-12  9:20 ` Robert Richter
  0 siblings, 1 reply; 2+ messages in thread
From: menglong8.dong @ 2021-01-12  8:46 UTC (permalink / raw)
  To: khuong
  Cc: bp, mchehab, tony.luck, james.morse, rric, linux-edac,
	linux-kernel, Menglong Dong

From: Menglong Dong <dong.menglong@zte.com.cn>

Coccinelle reports a redundant error print in xgene_edac_probe.
As 'platform_get_irq' already prints the error message, error
print here is redundant and can be removed.

Signed-off-by: Menglong Dong <dong.menglong@zte.com.cn>
---
 drivers/edac/xgene_edac.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c
index 1d2c27a00a4a..1d583f0ea4dc 100644
--- a/drivers/edac/xgene_edac.c
+++ b/drivers/edac/xgene_edac.c
@@ -1918,7 +1918,6 @@ static int xgene_edac_probe(struct platform_device *pdev)
 		for (i = 0; i < 3; i++) {
 			irq = platform_get_irq(pdev, i);
 			if (irq < 0) {
-				dev_err(&pdev->dev, "No IRQ resource\n");
 				rc = -EINVAL;
 				goto out_err;
 			}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] edac: remove redundant error print in xgene_edac_probe
  2021-01-12  8:46 [PATCH] edac: remove redundant error print in xgene_edac_probe menglong8.dong
@ 2021-01-12  9:20 ` Robert Richter
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Richter @ 2021-01-12  9:20 UTC (permalink / raw)
  To: menglong8.dong
  Cc: khuong, bp, mchehab, tony.luck, james.morse, linux-edac,
	linux-kernel, Menglong Dong

On 12.01.21 00:46:05, menglong8.dong@gmail.com wrote:
> From: Menglong Dong <dong.menglong@zte.com.cn>
> 
> Coccinelle reports a redundant error print in xgene_edac_probe.
> As 'platform_get_irq' already prints the error message, error
> print here is redundant and can be removed.
> 
> Signed-off-by: Menglong Dong <dong.menglong@zte.com.cn>
> ---
>  drivers/edac/xgene_edac.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c
> index 1d2c27a00a4a..1d583f0ea4dc 100644
> --- a/drivers/edac/xgene_edac.c
> +++ b/drivers/edac/xgene_edac.c
> @@ -1918,7 +1918,6 @@ static int xgene_edac_probe(struct platform_device *pdev)
>  		for (i = 0; i < 3; i++) {
>  			irq = platform_get_irq(pdev, i);
>  			if (irq < 0) {
> -				dev_err(&pdev->dev, "No IRQ resource\n");

Better call platform_get_irq_optional() instead. That would keep the
same error message patterns for all error paths of the probe function.

-Robert

>  				rc = -EINVAL;
>  				goto out_err;
>  			}
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-12  9:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12  8:46 [PATCH] edac: remove redundant error print in xgene_edac_probe menglong8.dong
2021-01-12  9:20 ` Robert Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).