* [PATCH] ASoC: spear: Delete an error message for a failed memory allocation in two functions
@ 2017-08-10 8:07 SF Markus Elfring
2017-08-10 8:25 ` Viresh Kumar
0 siblings, 1 reply; 2+ messages in thread
From: SF Markus Elfring @ 2017-08-10 8:07 UTC (permalink / raw)
To: alsa-devel, Gustavo A. R. Silva, Jaroslav Kysela, Liam Girdwood,
Mark Brown, Takashi Iwai
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 10 Aug 2017 09:50:51 +0200
Omit an extra message for a memory allocation failure in these functions.
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>
---
sound/soc/spear/spdif_in.c | 4 +---
sound/soc/spear/spdif_out.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/sound/soc/spear/spdif_in.c b/sound/soc/spear/spdif_in.c
index 7f32527fc3c8..01b28e59b4c0 100644
--- a/sound/soc/spear/spdif_in.c
+++ b/sound/soc/spear/spdif_in.c
@@ -216,10 +216,8 @@ static int spdif_in_probe(struct platform_device *pdev)
return -EINVAL;
host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
- if (!host) {
- dev_warn(&pdev->dev, "kzalloc fail\n");
+ if (!host)
return -ENOMEM;
- }
host->io_base = io_base;
host->irq = platform_get_irq(pdev, 0);
diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c
index 0a72d52d533e..58d5843811f9 100644
--- a/sound/soc/spear/spdif_out.c
+++ b/sound/soc/spear/spdif_out.c
@@ -282,10 +282,8 @@ static int spdif_out_probe(struct platform_device *pdev)
int ret;
host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
- if (!host) {
- dev_warn(&pdev->dev, "kzalloc fail\n");
+ if (!host)
return -ENOMEM;
- }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
host->io_base = devm_ioremap_resource(&pdev->dev, res);
--
2.13.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: spear: Delete an error message for a failed memory allocation in two functions
2017-08-10 8:07 [PATCH] ASoC: spear: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
@ 2017-08-10 8:25 ` Viresh Kumar
0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2017-08-10 8:25 UTC (permalink / raw)
To: SF Markus Elfring
Cc: alsa-devel, Gustavo A. R. Silva, Jaroslav Kysela, Liam Girdwood,
Mark Brown, Takashi Iwai, LKML, kernel-janitors
On Thu, Aug 10, 2017 at 1:37 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Thu, 10 Aug 2017 09:50:51 +0200
>
> Omit an extra message for a memory allocation failure in these functions.
>
> 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>
> ---
> sound/soc/spear/spdif_in.c | 4 +---
> sound/soc/spear/spdif_out.c | 4 +---
> 2 files changed, 2 insertions(+), 6 deletions(-)
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-10 8:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-10 8:07 [PATCH] ASoC: spear: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
2017-08-10 8:25 ` Viresh Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).