Patchwork PM / AVS: SmartReflex: NULL check before some freeing functions is not needed.

login
register
mail settings
Submitter Thomas Meyer
Date Dec. 2, 2018, 8:52 p.m.
Message ID <1543760930051-514988180-4-diffsplit-thomas@m3y3r.de>
Download mbox | patch
Permalink /patch/669969/
State New
Headers show

Comments

Thomas Meyer - Dec. 2, 2018, 8:52 p.m.
NULL check before some freeing functions is not needed.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---
Kevin Hilman - Dec. 11, 2018, 6:53 p.m.
Thomas Meyer <thomas@m3y3r.de> writes:

> NULL check before some freeing functions is not needed.
>
> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>

Reviewed-by: Kevin Hilman <khilman@baylibre.com>

> ---
>
> diff -u -p a/drivers/power/avs/smartreflex.c b/drivers/power/avs/smartreflex.c
> --- a/drivers/power/avs/smartreflex.c
> +++ b/drivers/power/avs/smartreflex.c
> @@ -1010,8 +1010,7 @@ static int omap_sr_remove(struct platfor
>  
>  	if (sr_info->autocomp_active)
>  		sr_stop_vddautocomp(sr_info);
> -	if (sr_info->dbg_dir)
> -		debugfs_remove_recursive(sr_info->dbg_dir);
> +	debugfs_remove_recursive(sr_info->dbg_dir);
>  
>  	pm_runtime_disable(&pdev->dev);
>  	list_del(&sr_info->node);

Patch

diff -u -p a/drivers/power/avs/smartreflex.c b/drivers/power/avs/smartreflex.c
--- a/drivers/power/avs/smartreflex.c
+++ b/drivers/power/avs/smartreflex.c
@@ -1010,8 +1010,7 @@  static int omap_sr_remove(struct platfor
 
 	if (sr_info->autocomp_active)
 		sr_stop_vddautocomp(sr_info);
-	if (sr_info->dbg_dir)
-		debugfs_remove_recursive(sr_info->dbg_dir);
+	debugfs_remove_recursive(sr_info->dbg_dir);
 
 	pm_runtime_disable(&pdev->dev);
 	list_del(&sr_info->node);