Skip to contentSkip to conversation

guessing

PATCH In review Jonathan Cameron 1 participant 2 messages Jan 8, 2017

Subsystems (2)
lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

PATCH 1/1 guessing

---
 drivers/iio/adc/qcom-spmi-vadc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/qcom-spmi-vadc.c +1 -1
index faaf711325b5..0a19761d656c 100644
@@ -641,7 +641,7 @@ static int vadc_scale_therm(struct vadc_priv *vadc,
 	vadc_scale_calib(vadc, adc_code, prop, &voltage);
 
 	if (prop->calibration == VADC_CALIB_ABSOLUTE)
-		voltage /= 1000;
+		voltage = div64_s64(voltage, 1000);
 
 	vadc_map_voltage_temp(adcmap_100k_104ef_104fb,
 			      ARRAY_SIZE(adcmap_100k_104ef_104fb),
Signature · 1 line
2.11.0
author maintainer
#1 lore raw

On 08/01/17 21:01, Jonathan Cameron wrote:
And that wasn't meant to go out with this title.

Sorry.

Jonathan

Quoted 18 lines
---
 drivers/iio/adc/qcom-spmi-vadc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/qcom-spmi-vadc.c +1 -1
index faaf711325b5..0a19761d656c 100644
@@ -641,7 +641,7 @@ static int vadc_scale_therm(struct vadc_priv *vadc,
 	vadc_scale_calib(vadc, adc_code, prop, &voltage);
 
 	if (prop->calibration == VADC_CALIB_ABSOLUTE)
-		voltage /= 1000;
+		voltage = div64_s64(voltage, 1000);
 
 	vadc_map_voltage_temp(adcmap_100k_104ef_104fb,
 			      ARRAY_SIZE(adcmap_100k_104ef_104fb),