diff mbox series

[3/6] thermal/core: Remove pointless test with the THERMAL_TRIPS_NONE macro

Message ID 20201214233811.485669-3-daniel.lezcano@linaro.org
State Accepted
Commit 53f04ca8153cc043cd2fa968ed451a85e8f70bd8
Headers show
Series [1/6] thermal/core: Remove the 'forced_passive' option | expand

Commit Message

Daniel Lezcano Dec. 14, 2020, 11:38 p.m. UTC
The THERMAL_TRIPS_NONE is equal to -1, it is pointless to do a
conversion in this function.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

---
 drivers/thermal/thermal_sysfs.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

-- 
2.25.1

Comments

Thara Gopinath Jan. 11, 2021, 11:17 p.m. UTC | #1
On 12/14/20 6:38 PM, Daniel Lezcano wrote:
> The THERMAL_TRIPS_NONE is equal to -1, it is pointless to do a

> conversion in this function.


It is pointless because you have removed force_passive and
will be removing THERMAL_TRIPS_NONE in the following patches.
Maybe that should be mentioned in the commit message.
Otherwise,

Reviewed-by: Thara Gopinath <thara.gopinath@linaro.org>


> 

> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

> ---

>   drivers/thermal/thermal_sysfs.c | 5 +----

>   1 file changed, 1 insertion(+), 4 deletions(-)

> 

> diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c

> index 4e7f9e880d76..345917a58f2f 100644

> --- a/drivers/thermal/thermal_sysfs.c

> +++ b/drivers/thermal/thermal_sysfs.c

> @@ -875,10 +875,7 @@ trip_point_show(struct device *dev, struct device_attribute *attr, char *buf)

>   	instance =

>   	    container_of(attr, struct thermal_instance, attr);

>   

> -	if (instance->trip == THERMAL_TRIPS_NONE)

> -		return sprintf(buf, "-1\n");

> -	else

> -		return sprintf(buf, "%d\n", instance->trip);

> +	return sprintf(buf, "%d\n", instance->trip);

>   }

>   

>   ssize_t

> 


-- 
Warm Regards
Thara
diff mbox series

Patch

diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index 4e7f9e880d76..345917a58f2f 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -875,10 +875,7 @@  trip_point_show(struct device *dev, struct device_attribute *attr, char *buf)
 	instance =
 	    container_of(attr, struct thermal_instance, attr);
 
-	if (instance->trip == THERMAL_TRIPS_NONE)
-		return sprintf(buf, "-1\n");
-	else
-		return sprintf(buf, "%d\n", instance->trip);
+	return sprintf(buf, "%d\n", instance->trip);
 }
 
 ssize_t