Skip to content

Commit

Permalink
ASoC: spear: Delete an error message for a failed memory allocation i…
Browse files Browse the repository at this point in the history
…n 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>
  • Loading branch information
Markus Elfring authored and Mark Brown committed Aug 10, 2017
1 parent 27d3040 commit 65d55e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions sound/soc/spear/spdif_in.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions sound/soc/spear/spdif_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 65d55e8

Please sign in to comment.