Skip to contentSkip to conversation

Pinctrl-single: Adjustments for two function implementations

PATCH In review SF Markus Elfring 2 participants 5 messages Dec 25, 2017 – Jan 2, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover Pinctrl-single: Adjustments for two function implementations

From: Markus Elfring <[email protected]>
Date: Mon, 25 Dec 2017 14:01:23 +0100

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
Delete an error message for a failed memory allocation in pcs_probe() Delete an unnecessary return statement in pcs_irq_chain_handler()

 drivers/pinctrl/pinctrl-single.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
Signature · 1 line
2.15.1
#1 lore raw

PATCH 1/2 pinctrl: single: Delete an error message for a failed memory allocation in pcs_probe()

From: Markus Elfring <[email protected]>
Date: Mon, 25 Dec 2017 11:27:55 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 drivers/pinctrl/pinctrl-single.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/pinctrl/pinctrl-single.c +2 -3
index e6cd8de793e2..f5ff2111481d 100644
@@ -1646,10 +1646,9 @@ static int pcs_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	pcs = devm_kzalloc(&pdev->dev, sizeof(*pcs), GFP_KERNEL);
-	if (!pcs) {
-		dev_err(&pdev->dev, "could not allocate\n");
+	if (!pcs)
 		return -ENOMEM;
-	}
+
 	pcs->dev = &pdev->dev;
 	pcs->np = np;
 	raw_spin_lock_init(&pcs->lock);
Signature · 1 line
2.15.1
#2 lore raw

Re: [PATCH 1/2] pinctrl: single: Delete an error message for a failed memory allocation in pcs_probe()

Quoted 8 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Mon, 25 Dec 2017 11:27:55 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Patch applied.

Yours,
Linus Walleij

#3 lore raw

PATCH 2/2 pinctrl: single: Delete an unnecessary return statement in pcs_irq_chain_handler()

In reply to SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Mon, 25 Dec 2017 11:35:44 +0100

The script "checkpatch.pl" pointed information out like the following.

WARNING: void function return statements are not generally useful

Thus remove such a statement in the affected function.

---
 drivers/pinctrl/pinctrl-single.c | 2 --
 1 file changed, 2 deletions(-)
drivers/pinctrl/pinctrl-single.c +0 -2
index f5ff2111481d..16689195e481 100644
@@ -1459,8 +1459,6 @@ static void pcs_irq_chain_handler(struct irq_desc *desc)
 	pcs_irq_handle(pcs_soc);
 	/* REVISIT: export and add handle_bad_irq(irq, desc)? */
 	chained_irq_exit(chip, desc);
-
-	return;
 }
 
 static int pcs_irqdomain_map(struct irq_domain *d, unsigned int irq,
Signature · 1 line
2.15.1
#4 lore raw

Re: [PATCH 2/2] pinctrl: single: Delete an unnecessary return statement in pcs_irq_chain_handler()

Quoted 10 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Mon, 25 Dec 2017 11:35:44 +0100

The script "checkpatch.pl" pointed information out like the following.

WARNING: void function return statements are not generally useful

Thus remove such a statement in the affected function.

Patch applied.

Yours,
Linus Walleij