Skip to contentSkip to conversation

pinctrl: msm: Delete an error message for a failed memory allocation in msm_pinctrl_probe()

PATCH In review SF Markus Elfring 3 participants 3 messages Dec 27, 2017 – Dec 28, 2017

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

PATCH 1/1 pinctrl: msm: Delete an error message for a failed memory allocation in msm_pinctrl_probe()

From: Markus Elfring <[email protected]>
Date: Wed, 27 Dec 2017 22:04:22 +0100

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

This issue was detected by using the Coccinelle software.

---
 drivers/pinctrl/qcom/pinctrl-msm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/pinctrl/qcom/pinctrl-msm.c +2 -3
index 7a960590ecaa..495432f3341b 100644
@@ -898,10 +898,9 @@ int msm_pinctrl_probe(struct platform_device *pdev,
 	int ret;
 
 	pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
-	if (!pctrl) {
-		dev_err(&pdev->dev, "Can't allocate msm_pinctrl\n");
+	if (!pctrl)
 		return -ENOMEM;
-	}
+
 	pctrl->dev = &pdev->dev;
 	pctrl->soc = soc_data;
 	pctrl->chip = msm_gpio_template;
Signature · 1 line
2.15.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Wed, 27 Dec 2017 22:04:22 +0100

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

This issue was detected by using the Coccinelle software.

Thank's Markus,

Regards,
Bjorn

Quoted 24 lines
---
 drivers/pinctrl/qcom/pinctrl-msm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/pinctrl/qcom/pinctrl-msm.c +2 -3
index 7a960590ecaa..495432f3341b 100644
@@ -898,10 +898,9 @@ int msm_pinctrl_probe(struct platform_device *pdev,
 	int ret;
 
 	pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
-	if (!pctrl) {
-		dev_err(&pdev->dev, "Can't allocate msm_pinctrl\n");
+	if (!pctrl)
 		return -ENOMEM;
-	}
+
 	pctrl->dev = &pdev->dev;
 	pctrl->soc = soc_data;
 	pctrl->chip = msm_gpio_template;
Signature · 1 line
2.15.1
#2 lore raw
In reply to SF Markus Elfring
Quoted 8 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Wed, 27 Dec 2017 22:04:22 +0100

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

This issue was detected by using the Coccinelle software.

Patch applied with Björn's ACK.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html