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

thermal/drivers/ti-soc-thermal/bandgap Remove unused variable 'val'

The function ti_bandgap_restore_ctxt() restores the context at resume
time. It checks if the sensor has a counter, reads the register but
does nothing with the value.

The block was probably omitted by the commit b87ea759a4cc.

Remove the unused variable as well as the block using it as we can
consider it as dead code.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: b87ea759a4cc ("staging: omap-thermal: fix context restore function")
Signed-off-by: Lin Ruizhe <linruizhe@huawei.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210421084256.57591-1-linruizhe@huawei.com

authored by

Lin Ruizhe and committed by
Daniel Lezcano
d473327f bd5d5536

-4
-4
drivers/thermal/ti-soc-thermal/ti-bandgap.c
··· 1142 1142 for (i = 0; i < bgp->conf->sensor_count; i++) { 1143 1143 struct temp_sensor_registers *tsr; 1144 1144 struct temp_sensor_regval *rval; 1145 - u32 val = 0; 1146 1145 1147 1146 rval = &bgp->regval[i]; 1148 1147 tsr = bgp->conf->sensors[i].registers; 1149 - 1150 - if (TI_BANDGAP_HAS(bgp, COUNTER)) 1151 - val = ti_bandgap_readl(bgp, tsr->bgap_counter); 1152 1148 1153 1149 if (TI_BANDGAP_HAS(bgp, TSHUT_CONFIG)) 1154 1150 ti_bandgap_writel(bgp, rval->tshut_threshold,