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

Message ID 0ea6dba4-0c52-4c9c-ae7e-d80c2f3d50f3@users.sourceforge.net
State New
Headers show
Series
  • gpio-intel-mid: Delete an error message for a failed memory allocation in intel_gpio_probe()
Related show

Commit Message

SF Markus Elfring Feb. 11, 2018, 9:04 p.m.
From: Markus Elfring <elfring@users.sourceforge.net>
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.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/gpio/gpio-intel-mid.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Andy Shevchenko Feb. 13, 2018, 6:45 p.m. | #1
On Sun, Feb 11, 2018 at 11:04 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/gpio/gpio-intel-mid.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpio/gpio-intel-mid.c b/drivers/gpio/gpio-intel-mid.c
> index 629575ea46a0..028d64c2cb1e 100644
> --- a/drivers/gpio/gpio-intel-mid.c
> +++ b/drivers/gpio/gpio-intel-mid.c
> @@ -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
>
Linus Walleij Feb. 22, 2018, 2:29 p.m. | #2
On Sun, Feb 11, 2018 at 10:04 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> 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.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Patch applied.

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

Patch

diff --git a/drivers/gpio/gpio-intel-mid.c b/drivers/gpio/gpio-intel-mid.c
index 629575ea46a0..028d64c2cb1e 100644
--- a/drivers/gpio/gpio-intel-mid.c
+++ b/drivers/gpio/gpio-intel-mid.c
@@ -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);