EDAC/altera: Remove redundant error logging
authorDeepak R Varma <drv@mailo.com>
Wed, 1 Mar 2023 19:13:31 +0000 (00:43 +0530)
committerBorislav Petkov (AMD) <bp@alien8.de>
Tue, 21 Mar 2023 21:50:46 +0000 (22:50 +0100)
A call to platform_get_irq() already prints an error on failure within
its own implementation. So printing another error based on its return
value in the caller is redundant and should be removed. The clean up
also makes if condition block braces unnecessary. Remove that as well.

Issue identified using platform_get_irq.cocci coccinelle semantic patch.

Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/Y/+j27kqdhflPtaj@ubun2204.myguest.virtualbox.org
drivers/edac/altera_edac.c

index e7e8e624a4362b3ee6a60998a1ddf0928f682d4e..72fa49c443609b815b4376aa5f08b176fe628c9e 100644 (file)
@@ -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,9 @@ 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