pwm: atmel-tcb: Delete an error message for a failed memory allocation in atmel_tcb_pwm_probe()
Subsystems (3)
PATCH 1/1 pwm: atmel-tcb: Delete an error message for a failed memory allocation in atmel_tcb_pwm_probe()
From: Markus Elfring <[email protected]>
Date: Fri, 15 Dec 2017 18:55:11 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
--- drivers/pwm/pwm-atmel-tcb.c | 1 - 1 file changed, 1 deletion(-)
drivers/pwm/pwm-atmel-tcb.c +0 -1
@@ -401,7 +401,6 @@ static int atmel_tcb_pwm_probe(struct platform_device *pdev) tcbpwm =devm_kzalloc (&pdev->dev,sizeof (*tcbpwm),GFP_KERNEL );if (tcbpwm =NULL ) { err = -ENOMEM ; -dev_err (&pdev->dev,"failed to allocate memory\n" ); goto err_free_tc; }
Signature · 1 line
2.15.1
Nicolas Ferre
maintainerHi,
Quoted 6 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Fri, 15 Dec 2017 18:55:11 +0100Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Can you point which coccinelle script highlited this issue?
Quoted 10 lines
Signed-off-by Markus Elfring <[email protected]>--- drivers/pwm/pwm-atmel-tcb.c | 1 - 1 file changed, 1 deletion(-)drivers/pwm/pwm-atmel-tcb.c +0
-0
drivers/pwm/pwm-atmel-tcb.c static int atmel_tcb_pwm_probe(struct platform_device *pdev) · line 404
Quoted 4 lines
drivers/pwm/pwm-atmel-tcb.c +0
-1@@ -401,7 +401,6 @@ static int atmel_tcb_pwm_probe(struct platform_device *pdev) tcbpwm =devm_kzalloc (&pdev->dev,sizeof (*tcbpwm),GFP_KERNEL );if (tcbpwm =NULL ) { err = -ENOMEM ; -dev_err (&pdev->dev,"failed to allocate memory\n" );
We have this in case of error:
atmel-tcb-pwm pwm: failed to allocate memory
atmel-tcb-pwm: probe of pwm failed with error -12
Which is somehow redundant I admit...
Quoted 4 lines
drivers/pwm/pwm-atmel-tcb.c +0
-0goto err_free_tc; }
Signature · 1 line
Nicolas Ferre
Quoted 5 lines
Quoted 3 lines
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Can you point which coccinelle script highlited this issue?
Not directly (so far).
I constructed an approach for the semantic patch language based on information from the script “checkpatch.pl”.
Would you like to improve it any ways?
Regards,
Markus
Thierry Reding
AppliedQuoted 11 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Fri, 15 Dec 2017 18:55:11 +0100Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>--- drivers/pwm/pwm-atmel-tcb.c | 1 - 1 file changed, 1 deletion(-)
Applied, thanks.
Thierry