linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] EDAC/altera: Remove unnecessary print function dev_err()
@ 2022-03-17 23:37 Yang Li
  2022-03-21 15:10 ` Dinh Nguyen
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2022-03-17 23:37 UTC (permalink / raw)
  To: dinguyen
  Cc: bp, mchehab, tony.luck, james.morse, rric, linux-edac,
	linux-kernel, Yang Li, Abaci Robot

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

Eliminate the follow coccicheck warnings:
./drivers/edac/altera_edac.c:2153:2-9: line 2153 is redundant because
platform_get_irq() already prints an error
./drivers/edac/altera_edac.c:2188:2-9: line 2188 is redundant because
platform_get_irq() already prints an error

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/edac/altera_edac.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index e7e8e624a436..47dc35938fa8 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -2149,10 +2149,8 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
 	}
 
 	edac->sb_irq = platform_get_irq(pdev, 0);
-	if (edac->sb_irq < 0) {
-		dev_err(&pdev->dev, "No SBERR IRQ resource\n");
+	if (edac->sb_irq < 0)
 		return edac->sb_irq;
-	}
 
 	irq_set_chained_handler_and_data(edac->sb_irq,
 					 altr_edac_a10_irq_handler,
@@ -2184,10 +2182,8 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
 	}
 #else
 	edac->db_irq = platform_get_irq(pdev, 1);
-	if (edac->db_irq < 0) {
-		dev_err(&pdev->dev, "No DBERR IRQ resource\n");
+	if (edac->db_irq < 0)
 		return edac->db_irq;
-	}
 	irq_set_chained_handler_and_data(edac->db_irq,
 					 altr_edac_a10_irq_handler, edac);
 #endif
-- 
2.20.1.7.g153144c


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

* Re: [PATCH -next] EDAC/altera: Remove unnecessary print function dev_err()
  2022-03-17 23:37 [PATCH -next] EDAC/altera: Remove unnecessary print function dev_err() Yang Li
@ 2022-03-21 15:10 ` Dinh Nguyen
  0 siblings, 0 replies; 2+ messages in thread
From: Dinh Nguyen @ 2022-03-21 15:10 UTC (permalink / raw)
  To: Yang Li
  Cc: bp, mchehab, tony.luck, james.morse, rric, linux-edac,
	linux-kernel, Abaci Robot



On 3/17/22 18:37, Yang Li wrote:
> The print function dev_err() is redundant because platform_get_irq()
> already prints an error.
> 
> Eliminate the follow coccicheck warnings:
> ./drivers/edac/altera_edac.c:2153:2-9: line 2153 is redundant because
> platform_get_irq() already prints an error
> ./drivers/edac/altera_edac.c:2188:2-9: line 2188 is redundant because
> platform_get_irq() already prints an error
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>   drivers/edac/altera_edac.c | 8 ++------
>   1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
> index e7e8e624a436..47dc35938fa8 100644
> --- a/drivers/edac/altera_edac.c
> +++ b/drivers/edac/altera_edac.c
> @@ -2149,10 +2149,8 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
>   	}
>   
>   	edac->sb_irq = platform_get_irq(pdev, 0);
> -	if (edac->sb_irq < 0) {
> -		dev_err(&pdev->dev, "No SBERR IRQ resource\n");
> +	if (edac->sb_irq < 0)
>   		return edac->sb_irq;
> -	}
>   
>   	irq_set_chained_handler_and_data(edac->sb_irq,
>   					 altr_edac_a10_irq_handler,
> @@ -2184,10 +2182,8 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
>   	}
>   #else
>   	edac->db_irq = platform_get_irq(pdev, 1);
> -	if (edac->db_irq < 0) {
> -		dev_err(&pdev->dev, "No DBERR IRQ resource\n");
> +	if (edac->db_irq < 0)
>   		return edac->db_irq;
> -	}
>   	irq_set_chained_handler_and_data(edac->db_irq,
>   					 altr_edac_a10_irq_handler, edac);
>   #endif

Acked-by: Dinh Nguyen <dinguyen@kernel.org>

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

end of thread, other threads:[~2022-03-21 15:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-17 23:37 [PATCH -next] EDAC/altera: Remove unnecessary print function dev_err() Yang Li
2022-03-21 15:10 ` Dinh Nguyen

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).