Skip to contentSkip to conversation

gpio: merrifield: Delete an error message for a failed memory allocation in mrfld_gpio_probe()

PATCH In review SF Markus Elfring 3 participants 3 messages Feb 11, 2018 – Feb 22, 2018

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

PATCH 1/1 gpio: merrifield: Delete an error message for a failed memory allocation in mrfld_gpio_probe()

From: Markus Elfring <[email protected]>
Date: Sun, 11 Feb 2018 13:30:14 +0100

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

This issue was detected by using the Coccinelle software.

---
 drivers/gpio/gpio-merrifield.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-merrifield.c +1 -3
index dd67a31ac337..eec21122299e 100644
@@ -408,10 +408,8 @@ static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id
 	pcim_iounmap_regions(pdev, BIT(1));
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
-	if (!priv) {
-		dev_err(&pdev->dev, "can't allocate chip data\n");
+	if (!priv)
 		return -ENOMEM;
-	}
 
 	priv->dev = &pdev->dev;
 	priv->reg_base = pcim_iomap_table(pdev)[0];
Signature · 1 line
2.16.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Sun, 11 Feb 2018 13:30:14 +0100

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

This issue was detected by using the Coccinelle software.

Linus, I have no strong opinion here, so, up to you to decide.

If you decide this patch to go,

Quoted 23 lines
---
 drivers/gpio/gpio-merrifield.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio- renamed from drivers/gpio/gpio-merrifield.c +0 -0

merrifield.c
index dd67a31ac337..eec21122299e 100644

drivers/gpio/gpio-merrifield.c +0 -0
@@ -408,10 +408,8 @@ static int mrfld_gpio_probe(struct pci_dev *pdev,

const struct pci_device_id *id

drivers/gpio/gpio-merrifield.c +1 -3
 	pcim_iounmap_regions(pdev, BIT(1));
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
-	if (!priv) {
-		dev_err(&pdev->dev, "can't allocate chip data\n");
+	if (!priv)
 		return -ENOMEM;
-	}
 
 	priv->dev = &pdev->dev;
 	priv->reg_base = pcim_iomap_table(pdev)[0];
Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy