diff options
author | Rex Nie <rex.nie@jaguarmicro.com> | 2024-11-13 03:54:12 +0300 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2024-11-13 20:37:00 +0300 |
commit | d8afb8cc8bbab13f97cd76aaf716de97f222cd71 (patch) | |
tree | ddc1f1caf87be9dad6bbda31b0fb435ac9f55b9b | |
parent | e2ffb6c3a40ee714160e35e61f0a984028b5d550 (diff) | |
download | linux-d8afb8cc8bbab13f97cd76aaf716de97f222cd71.tar.xz |
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>
-rw-r--r-- | drivers/thermal/k3_j72xx_bandgap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c index ccd42db97177..70de6dbf99c5 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]; |