[PATCH] thermal/drivers/k3_j72xx_bandgap: Simplify code in k3_bgp_read_temp()

Rex Nie posted 1 patch 1 week, 3 days ago
drivers/thermal/k3_j72xx_bandgap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] thermal/drivers/k3_j72xx_bandgap: Simplify code in k3_bgp_read_temp()
Posted by Rex Nie 1 week, 3 days ago
The return value of vtm_get_best_value() always >= 0, remove always
false expression 'dtemp < 0' in if statement.

Signed-off-by: Rex Nie <rex.nie@jaguarmicro.com>
---
 drivers/thermal/k3_j72xx_bandgap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c
index 9bc279ac131a..1e66c98f7a61 100644
--- a/drivers/thermal/k3_j72xx_bandgap.c
+++ b/drivers/thermal/k3_j72xx_bandgap.c
@@ -238,7 +238,7 @@ static inline int k3_bgp_read_temp(struct k3_thermal_data *devdata,
 		K3_VTM_TS_STAT_DTEMP_MASK;
 	dtemp = vtm_get_best_value(s0, s1, s2);
 
-	if (dtemp < 0 || dtemp >= TABLE_SIZE)
+	if (dtemp >= TABLE_SIZE)
 		return -EINVAL;
 
 	*temp = derived_table[dtemp];
-- 
2.17.1
Re: [PATCH] thermal/drivers/k3_j72xx_bandgap: Simplify code in k3_bgp_read_temp()
Posted by Daniel Lezcano 1 week, 2 days ago
On 13/11/2024 01:54, Rex Nie wrote:
> The return value of vtm_get_best_value() always >= 0, remove always
> false expression 'dtemp < 0' in if statement.
> 
> Signed-off-by: Rex Nie <rex.nie@jaguarmicro.com>
> ---

Applied, thanks


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