iio:adc:qcom-spmi-vadc: use div64_s64 instead of direct 64 bit division.
Subsystems (2)
Jonathan Cameron
maintainerPATCH 1/1 iio:adc:qcom-spmi-vadc: use div64_s64 instead of direct 64 bit division.
Another one of these that we missed previously which prevents test builds of this driver on 32 bit platforms as it gives an undefined __divdi3 warning.
--- drivers/iio/adc/qcom-spmi-vadc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/qcom-spmi-vadc.c +1 -1
@@ -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
Jonathan Cameron
maintainerQuoted 3 lines · Jonathan Cameron
Another one of these that we missed previously which prevents test builds of this driver on 32 bit platforms as it gives an undefined
__divdi3warning.
I'm going to apply (well actually I already did by accident) this one and send a pull request to Greg.
We are far enough into the cycle that I want to start getting stuff into linux-next.
Rama, if you get a chance, please do test the 3 patches I've added to fix up build issues for this driver.
Thanks,
Jonathan
Quoted 19 lines
Signed-off-by Jonathan Cameron <[email protected]>--- drivers/iio/adc/qcom-spmi-vadc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/adc/qcom-spmi-vadc.c +1
-1@@ -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),
Hi Jonathan,
Sorry for delayed response.
Verified the patches and are working fine.
Thanks for posting the changes .
Thanks,
Ramakrishna
Quoted 36 lines · Jonathan Cameron
Quoted 3 lines · Jonathan Cameron
Another one of these that we missed previously which prevents test builds of this driver on 32 bit platforms as it gives an undefined
__divdi3warning.I'm going to apply (well actually I already did by accident) this one and send a pull request to Greg.
We are far enough into the cycle that I want to start getting stuff into linux-next.
Rama, if you get a chance, please do test the 3 patches I've added to fix up build issues for this driver.
Thanks,
Jonathan
Quoted 19 lines
Signed-off-by Jonathan Cameron <[email protected]>--- drivers/iio/adc/qcom-spmi-vadc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/adc/qcom-spmi-vadc.c +1
-1@@ -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),