Skip to contentSkip to conversation

i2c: qup: Remove dev_err() log after platform_get_irq*() failure

PATCH Superseded Saiyam Doshi 2 participants 3 messages Sep 16, 2019 – Sep 17, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 i2c: qup: Remove dev_err() log after platform_get_irq*() failure

The debug message after platform_get_irq() failure is redundant because platform_get_irq() already prints an error. Thus remove it.

The semantic patch that makes this report is available in scripts/coccinelle/api/platform_get_irq.cocci.

Found using - http://coccinelle.lip6.fr/

---
 drivers/i2c/busses/i2c-qup.c | 1 -
 1 file changed, 1 deletion(-)
drivers/i2c/busses/i2c-qup.c +0 -1
index 5519c19bfd9c..23c4893512b2 100644
@@ -1767,7 +1767,6 @@ static int qup_i2c_probe(struct platform_device *pdev)
 
 	qup->irq = platform_get_irq(pdev, 0);
 	if (qup->irq < 0) {
-		dev_err(qup->dev, "No IRQ defined\n");
 		return qup->irq;
 	}
 

--
2.20.1

#1 lore raw
Quoted 4 lines

The semantic patch that makes this report is available in scripts/coccinelle/api/platform_get_irq.cocci.

Found using - http://coccinelle.lip6.fr/

Can a tag like “Generated by: scripts/coccinelle/api/platform_get_irq.cocci” be more helpful than the other description variant?

drivers/i2c/busses/i2c-qup.c static int qup_i2c_probe(struct platform_device *pdev) · line 1771

Quoted 8 lines

+++ b/drivers/i2c/busses/i2c-qup.c

drivers/i2c/busses/i2c-qup.c +0 -1
@@ -1767,7 +1767,6 @@ static int qup_i2c_probe(struct platform_device *pdev)
 
 	qup->irq = platform_get_irq(pdev, 0);
 	if (qup->irq < 0) {
-		dev_err(qup->dev, "No IRQ defined\n");
 		return qup->irq;
 	}

How do you think about to omit the curly brackets here after only a single statement would be used in the if branch?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?id=ad062195731bea1624ce7160e79e0fcdaa25c1b5#n175

Regards,
Markus

#2 lore raw
Quoted 7 lines · Markus Elfring
Quoted 4 lines

The semantic patch that makes this report is available in scripts/coccinelle/api/platform_get_irq.cocci.

Found using - http://coccinelle.lip6.fr/

Can a tag like “Generated by: scripts/coccinelle/api/platform_get_irq.cocci” be more helpful than the other description variant?

Okay, will update the changelog.

Quoted 6 lines

drivers/i2c/busses/i2c-qup.c static int qup_i2c_probe(struct platform_device *pdev) · line 1771

Quoted 4 lines
drivers/i2c/busses/i2c-qup.c +0 -1
 	if (qup->irq < 0) {
-		dev_err(qup->dev, "No IRQ defined\n");
 		return qup->irq;
 	}

How do you think about to omit the curly brackets here after only a single statement would be used in the if branch?

Completely missed that! I will update and resend.

-Saiyam