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

Commit bb2c232a authored by Nicholas Troast's avatar Nicholas Troast
Browse files

iio: adc: qcom-tadc: cast raw ADC readings before conversion



Currently the code depends on implicit type conversion when converting
ADC readings. Make the type conversions explicit.

Change-Id: I09b5d4cd219b0a53559176525d9b501e5a6dc0c9
Signed-off-by: default avatarNicholas Troast <ntroast@codeaurora.org>
parent c74e83d4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -398,7 +398,7 @@ static int tadc_do_conversion(struct tadc_chip *chip, u8 channels, s16 *adc)
	}

	for (i = 0; i < TADC_NUM_CH; i++)
		adc[i] = val[i * 2] | val[i * 2 + 1] << BITS_PER_BYTE;
		adc[i] = (s16)(val[i * 2] | (u16)val[i * 2 + 1] << 8);

	return jiffies_to_msecs(timeout - timeleft);
}