diff mbox series

[v1] thermal/drivers/mediatek/lvts_thermal: remove extra error check in lvts_debugfs_init()

Message ID 20230921075518.3016-1-duminjie@vivo.com (mailing list archive)
State New
Delegated to: Daniel Lezcano
Headers show
Series [v1] thermal/drivers/mediatek/lvts_thermal: remove extra error check in lvts_debugfs_init() | expand

Commit Message

Minjie Du Sept. 21, 2023, 7:55 a.m. UTC
As per the comment above debugfs_create_dir(), it is not expected to
return an error, so an extra error check is not needed.
Drop the return check of debugfs_create_dir() in
lvts_debugfs_init()

Signed-off-by: Minjie Du <duminjie@vivo.com>
---
 drivers/thermal/mediatek/lvts_thermal.c | 2 --
 1 file changed, 2 deletions(-)

Comments

AngeloGioacchino Del Regno Sept. 21, 2023, 7:59 a.m. UTC | #1
Il 21/09/23 09:55, Minjie Du ha scritto:
> As per the comment above debugfs_create_dir(), it is not expected to
> return an error, so an extra error check is not needed.
> Drop the return check of debugfs_create_dir() in
> lvts_debugfs_init()
> 
> Signed-off-by: Minjie Du <duminjie@vivo.com>
> ---
>   drivers/thermal/mediatek/lvts_thermal.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
> index effd9b00a424..171ce25fddf5 100644
> --- a/drivers/thermal/mediatek/lvts_thermal.c
> +++ b/drivers/thermal/mediatek/lvts_thermal.c
> @@ -213,8 +213,6 @@ static int lvts_debugfs_init(struct device *dev, struct lvts_domain *lvts_td)
>   
>   		sprintf(name, "controller%d", i);
>   		dentry = debugfs_create_dir(name, lvts_td->dom_dentry);
> -		if (!dentry)
> -			continue;
>   

This is fine as it is: the `continue` is here in order to avoid allocating regset
if the debugfs dir couldn't be created.
NACK.

Regards,
Angelo

>   		regset = devm_kzalloc(dev, sizeof(*regset), GFP_KERNEL);
>   		if (!regset)
diff mbox series

Patch

diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
index effd9b00a424..171ce25fddf5 100644
--- a/drivers/thermal/mediatek/lvts_thermal.c
+++ b/drivers/thermal/mediatek/lvts_thermal.c
@@ -213,8 +213,6 @@  static int lvts_debugfs_init(struct device *dev, struct lvts_domain *lvts_td)
 
 		sprintf(name, "controller%d", i);
 		dentry = debugfs_create_dir(name, lvts_td->dom_dentry);
-		if (!dentry)
-			continue;
 
 		regset = devm_kzalloc(dev, sizeof(*regset), GFP_KERNEL);
 		if (!regset)