Skip to contentSkip to conversation

soc/tegra: cbb: Remove unnecessary print function dev_err()

PATCH New Yang Li 1 participant 1 message Jul 14, 2022 Tegra architecture support

lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 soc/tegra: cbb: Remove unnecessary print function dev_err()

platform_get_irq()<--platform_get_irq_optional() platform_get_irq_optional() return non-zero IRQ number on success, negative error number on failure, if IRQ number is 0, return -EINVAL. so the function platform_get_irq() never returns 0, and the print function dev_err() is redundant because platform_get_irq() already prints an error.

Eliminate the follow coccicheck warnings:
./drivers/soc/tegra/cbb/tegra-cbb.c:142:3-10: line 142 is redundant because platform_get_irq() already prints an error ./drivers/soc/tegra/cbb/tegra-cbb.c:152:2-9: line 152 is redundant because platform_get_irq() already prints an error

---
 drivers/soc/tegra/cbb/tegra-cbb.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/soc/tegra/cbb/tegra-cbb.c +2 -6
index d200937353c7..aa9fcbd5d4a7 100644
@@ -138,20 +138,16 @@ int tegra_cbb_get_irq(struct platform_device *pdev, unsigned int *nonsec_irq,
 
 	if (num_intr == 2) {
 		irq = platform_get_irq(pdev, index);
-		if (irq <= 0) {
-			dev_err(&pdev->dev, "failed to get non-secure IRQ: %d\n", irq);
+		if (irq < 0)
 			return -ENOENT;
-		}
 
 		*nonsec_irq = irq;
 		index++;
 	}
 
 	irq = platform_get_irq(pdev, index);
-	if (irq <= 0) {
-		dev_err(&pdev->dev, "failed to get secure IRQ: %d\n", irq);
+	if (irq < 0)
 		return -ENOENT;
-	}
 
 	*sec_irq = irq;
 
Signature · 1 line
2.20.1.7.g153144c