Skip to contentSkip to conversation

gpio-intel-mid: Delete an error message for a failed memory allocation in intel_gpio_probe()

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

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

PATCH 1/1 gpio-intel-mid: Delete an error message for a failed memory allocation in intel_gpio_probe()

From: Markus Elfring <[email protected]>
Date: Sun, 11 Feb 2018 21:56:42 +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-intel-mid.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-intel-mid.c +1 -3
index 629575ea46a0..028d64c2cb1e 100644
@@ -361,10 +361,8 @@ static int intel_gpio_probe(struct pci_dev *pdev,
 	pcim_iounmap_regions(pdev, 1 << 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->reg_base = pcim_iomap_table(pdev)[0];
 	priv->chip.label = dev_name(&pdev->dev);
Signature · 1 line
2.16.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Sun, 11 Feb 2018 21:56:42 +0100

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

This issue was detected by using the Coccinelle software.

Linus, same comment as previously.
If you are OK with the change, take my

Quoted 24 lines
---
 drivers/gpio/gpio-intel-mid.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-intel-mid.c +1 -4
index 629575ea46a0..028d64c2cb1e 100644
@@ -361,10 +361,8 @@ static int intel_gpio_probe(struct pci_dev *pdev,
        pcim_iounmap_regions(pdev, 1 << 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->reg_base = pcim_iomap_table(pdev)[0];
        priv->chip.label = dev_name(&pdev->dev);
--

2.16.1

Signature · 2 lines
With Best Regards,
Andy Shevchenko