diff mbox series

thermal/drivers/k3_j72xx_bandgap: Simplify code in k3_bgp_read_temp()

Message ID 20241113005412.2254-1-rex.nie@jaguarmicro.com (mailing list archive)
State New
Delegated to: Daniel Lezcano
Headers show
Series thermal/drivers/k3_j72xx_bandgap: Simplify code in k3_bgp_read_temp() | expand

Commit Message

Rex Nie Nov. 13, 2024, 12:54 a.m. UTC
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(-)

Comments

Daniel Lezcano Nov. 13, 2024, 5:37 p.m. UTC | #1
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
diff mbox series

Patch

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