Skip to contentSkip to conversation

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

PATCH In review Minjie Du 2 participants 2 messages Sep 21, 2023

Subsystems (2)
lore
Share & tools
lore

Minjie Du

author
#0 lore raw

PATCH 1/1 thermal/drivers/mediatek/lvts_thermal: remove extra error check in lvts_debugfs_init()

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()

---
 drivers/thermal/mediatek/lvts_thermal.c | 2 --
 1 file changed, 2 deletions(-)
drivers/thermal/mediatek/lvts_thermal.c +0 -2
index effd9b00a424..171ce25fddf5 100644
@@ -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)
Signature · 1 line
2.39.0
#1 lore raw

Il 21/09/23 09:55, Minjie Du ha scritto:

Quoted 15 lines

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()

---
  drivers/thermal/mediatek/lvts_thermal.c | 2 --
  1 file changed, 2 deletions(-)
drivers/thermal/mediatek/lvts_thermal.c +0 -0
index effd9b00a424..171ce25fddf5 100644

drivers/thermal/mediatek/lvts_thermal.c static int lvts_debugfs_init(struct device *dev, struct lvts_domain *lvts_td) · line 216

Quoted 6 lines
drivers/thermal/mediatek/lvts_thermal.c +0 -2
@@ -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

Quoted 2 lines
drivers/thermal/mediatek/lvts_thermal.c +0 -0
  		regset = devm_kzalloc(dev, sizeof(*regset), GFP_KERNEL);
  		if (!regset)