Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 160fb9d2 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

thermal: adc-tm: Fix uninitialized variable warning



In adc_tm5_thr_update, 'chip' is not initialized before it gets sent to
adc_tm5_get_btm_idx() but then it turns out that adc_tm5_get_btm_idx
doesn't even use the passed in pointer so nothing serious was happening
outside of the compiler warning.  Initialize the variable to fix the
warning but a wider fix to remove the variable is warranted in the
future.

 drivers/thermal/qcom/adc-tm5.c:265:
   'chip' is used uninitialized in this function [-Werror=uninitialized]

Fixes: bda25621 ("thermal: adc-tm: Add ADC_TM driver snapshot")
Change-Id: Ic0dedbad4eab1934bd6920beca2530bd870f5af4
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent d6b38125
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -260,7 +260,7 @@ static int32_t adc_tm5_thr_update(struct adc_tm_sensor *sensor,
	uint16_t reg_low_thr_lsb, reg_high_thr_lsb;
	uint32_t scale_type = 0, mask = 0, btm_chan_idx = 0;
	struct adc_tm_config tm_config;
	struct adc_tm_chip *chip;
	struct adc_tm_chip *chip = NULL;

	ret = adc_tm5_get_btm_idx(chip,
		sensor->btm_ch, &btm_chan_idx);