Commit d8afb8cc authored by Rex Nie's avatar Rex Nie Committed by Daniel Lezcano
Browse files

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



The return value of vtm_get_best_value() always >= 0, remove always
false expression 'dtemp < 0' in if statement.

Signed-off-by: default avatarRex Nie <rex.nie@jaguarmicro.com>
Link: https://lore.kernel.org/r/20241113005412.2254-1-rex.nie@jaguarmicro.com


Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent e2ffb6c3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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];