mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mmc: atmel-mci: Delete an error message for a failed memory allocation in atmci_of_init()
@ 2017-05-13 13:17 SF Markus Elfring
  2017-05-19  8:32 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: SF Markus Elfring @ 2017-05-13 13:17 UTC (permalink / raw)
  To: linux-mmc, Ludovic Desroches, Ulf Hansson
  Cc: LKML, kernel-janitors, Wolfram Sang

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 13 May 2017 15:05:28 +0200

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

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/mmc/host/atmel-mci.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 388e4a3f13e6..584247464eb8 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -667,10 +667,8 @@ atmci_of_init(struct platform_device *pdev)
 	}
 
 	pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
-	if (!pdata) {
-		dev_err(&pdev->dev, "could not allocate memory for pdata\n");
+	if (!pdata)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	for_each_child_of_node(np, cnp) {
 		if (of_property_read_u32(cnp, "reg", &slot_id)) {
-- 
2.12.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mmc: atmel-mci: Delete an error message for a failed memory allocation in atmci_of_init()
  2017-05-13 13:17 [PATCH] mmc: atmel-mci: Delete an error message for a failed memory allocation in atmci_of_init() SF Markus Elfring
@ 2017-05-19  8:32 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2017-05-19  8:32 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: linux-mmc, Ludovic Desroches, LKML, kernel-janitors, Wolfram Sang

On 13 May 2017 at 15:17, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 13 May 2017 15:05:28 +0200
>
> Omit an extra message for a memory allocation failure in this function.
>
> This issue was detected by using the Coccinelle software.
>
> Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Thanks applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/host/atmel-mci.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index 388e4a3f13e6..584247464eb8 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -667,10 +667,8 @@ atmci_of_init(struct platform_device *pdev)
>         }
>
>         pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
> -       if (!pdata) {
> -               dev_err(&pdev->dev, "could not allocate memory for pdata\n");
> +       if (!pdata)
>                 return ERR_PTR(-ENOMEM);
> -       }
>
>         for_each_child_of_node(np, cnp) {
>                 if (of_property_read_u32(cnp, "reg", &slot_id)) {
> --
> 2.12.3
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-19  8:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-13 13:17 [PATCH] mmc: atmel-mci: Delete an error message for a failed memory allocation in atmci_of_init() SF Markus Elfring
2017-05-19  8:32 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome