Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Rex Nie <rex.nie@jaguarmicro.com>
Link: https://lore.kernel.org/r/20241113005412.2254-1-rex.nie@jaguarmicro.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

authored by

Rex Nie and committed by
Daniel Lezcano
d8afb8cc e2ffb6c3

+1 -1
+1 -1
drivers/thermal/k3_j72xx_bandgap.c
··· 238 238 K3_VTM_TS_STAT_DTEMP_MASK; 239 239 dtemp = vtm_get_best_value(s0, s1, s2); 240 240 241 - if (dtemp < 0 || dtemp >= TABLE_SIZE) 241 + if (dtemp >= TABLE_SIZE) 242 242 return -EINVAL; 243 243 244 244 *temp = derived_table[dtemp];