diff options
| author | Markus Elfring <elfring@users.sourceforge.net> | 2017-08-10 03:50:51 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2017-08-10 10:53:21 -0400 |
| commit | 65d55e8a3bb2d2a98078590cfa49cd508aa80e81 (patch) | |
| tree | 1564e1dc61fbc26cce73ee0091d37a14f4e60939 | |
| parent | 27d30400c448264c1ac9434cb836de0c230af213 (diff) | |
ASoC: spear: Delete an error message for a failed memory allocation in two functions
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>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | sound/soc/spear/spdif_in.c | 4 | ||||
| -rw-r--r-- | 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) | |||
| 216 | return -EINVAL; | 216 | return -EINVAL; |
| 217 | 217 | ||
| 218 | host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL); | 218 | host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL); |
| 219 | if (!host) { | 219 | if (!host) |
| 220 | dev_warn(&pdev->dev, "kzalloc fail\n"); | ||
| 221 | return -ENOMEM; | 220 | return -ENOMEM; |
| 222 | } | ||
| 223 | 221 | ||
| 224 | host->io_base = io_base; | 222 | host->io_base = io_base; |
| 225 | host->irq = platform_get_irq(pdev, 0); | 223 | 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) | |||
| 282 | int ret; | 282 | int ret; |
| 283 | 283 | ||
| 284 | host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL); | 284 | host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL); |
| 285 | if (!host) { | 285 | if (!host) |
| 286 | dev_warn(&pdev->dev, "kzalloc fail\n"); | ||
| 287 | return -ENOMEM; | 286 | return -ENOMEM; |
| 288 | } | ||
| 289 | 287 | ||
| 290 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 288 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 291 | host->io_base = devm_ioremap_resource(&pdev->dev, res); | 289 | host->io_base = devm_ioremap_resource(&pdev->dev, res); |
