Skip to contentSkip to conversation

thermal/sysfs: remove unnecessary check in trip_point_hyst_show()

PATCH Applied Dan Carpenter 3 participants 3 messages Oct 15, 2022 – Dec 9, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal/sysfs: remove unnecessary check in trip_point_hyst_show()

The "ret" variable is zero at this point. No need to check.

---
 drivers/thermal/thermal_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/thermal_sysfs.c +1 -1
index 8d7b25ab67c2..af3dced054f3 100644
@@ -190,7 +190,7 @@ trip_point_hyst_show(struct device *dev, struct device_attribute *attr,
 	if (ret)
 		return ret;
 
-	return ret ? ret : sprintf(buf, "%d\n", trip.hysteresis);
+	return sprintf(buf, "%d\n", trip.hysteresis);
 }
 
 static ssize_t
Signature · 1 line
2.35.1
#1 lore raw
Quoted 4 lines · Dan Carpenter

The "ret" variable is zero at this point. No need to check.

---

Applied, thanks

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#2 lore raw
In reply to Dan Carpenter
The following commit has been merged into the thermal/next branch of thermal:

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     1627cd2f820ad90d3249e6b4e6f1dbadfbed0d33
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//1627cd2f820ad90d3249e6b4e6f1dbadfbed0d33
Author:        Dan Carpenter <[email protected]>
AuthorDate:    Sat, 15 Oct 2022 11:27:04 +03:00
Committer:     Daniel Lezcano <[email protected]>
CommitterDate: Thu, 08 Dec 2022 14:30:43 +01:00

thermal/sysfs: remove unnecessary check in trip_point_hyst_show()

The "ret" variable is zero at this point. No need to check.

---
 drivers/thermal/thermal_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/thermal_sysfs.c +1 -1
index cef860d..d37133a 100644
@@ -226,7 +226,7 @@ trip_point_hyst_show(struct device *dev, struct device_attribute *attr,
 
 	mutex_unlock(&tz->lock);
 
-	return ret ? ret : sprintf(buf, "%d\n", trip.hysteresis);
+	return sprintf(buf, "%d\n", trip.hysteresis);
 }
 
 static ssize_t