diff mbox

ASoC: Medfield: Delete an error message for a failed memory allocation in snd_mfld_mc_probe()

Message ID 161e9c4c-1c97-d06f-35ec-3f165ad9e52e@users.sourceforge.net (mailing list archive)
State Accepted
Commit 92ec46da6e35f5f7ff39741517a9466c82d1afb9
Headers show

Commit Message

SF Markus Elfring Aug. 11, 2017, 9:33 a.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 11 Aug 2017 11:25:41 +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>
---
 sound/soc/intel/boards/mfld_machine.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Vinod Koul Aug. 16, 2017, 4:58 a.m. UTC | #1
On Fri, Aug 11, 2017 at 11:33:56AM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 11 Aug 2017 11:25:41 +0200
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> This issue was detected by using the Coccinelle software.

Acked-By: Vinod Koul <vinod.koul@intel.com>

> 
> 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/intel/boards/mfld_machine.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/sound/soc/intel/boards/mfld_machine.c b/sound/soc/intel/boards/mfld_machine.c
> index 4e08885f37aa..6f44acfb4aae 100644
> --- a/sound/soc/intel/boards/mfld_machine.c
> +++ b/sound/soc/intel/boards/mfld_machine.c
> @@ -376,10 +376,8 @@ static int snd_mfld_mc_probe(struct platform_device *pdev)
>  	/* audio interrupt base of SRAM location where
>  	 * interrupts are stored by System FW */
>  	mc_drv_ctx = devm_kzalloc(&pdev->dev, sizeof(*mc_drv_ctx), GFP_ATOMIC);
> -	if (!mc_drv_ctx) {
> -		pr_err("allocation failed\n");
> +	if (!mc_drv_ctx)
>  		return -ENOMEM;
> -	}
>  
>  	irq_mem = platform_get_resource_byname(
>  				pdev, IORESOURCE_MEM, "IRQ_BASE");
> -- 
> 2.14.0
>
diff mbox

Patch

diff --git a/sound/soc/intel/boards/mfld_machine.c b/sound/soc/intel/boards/mfld_machine.c
index 4e08885f37aa..6f44acfb4aae 100644
--- a/sound/soc/intel/boards/mfld_machine.c
+++ b/sound/soc/intel/boards/mfld_machine.c
@@ -376,10 +376,8 @@  static int snd_mfld_mc_probe(struct platform_device *pdev)
 	/* audio interrupt base of SRAM location where
 	 * interrupts are stored by System FW */
 	mc_drv_ctx = devm_kzalloc(&pdev->dev, sizeof(*mc_drv_ctx), GFP_ATOMIC);
-	if (!mc_drv_ctx) {
-		pr_err("allocation failed\n");
+	if (!mc_drv_ctx)
 		return -ENOMEM;
-	}
 
 	irq_mem = platform_get_resource_byname(
 				pdev, IORESOURCE_MEM, "IRQ_BASE");