[PATCH 1/2] iio:adc:qcom-spmi-vadc : fix undefined __divdi3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A simple do_div call works here as all the signed 64 bit is
actually small and unsigned at this point, and the numerator is
u32.

Signed-off-by: Jonathan Cameron <jic23@xxxxxxxxxx>
Reported-by: kbuild test robot <fengguang.wu@xxxxxxxxx>
Cc: Rama Krishna Phani A <rphani@xxxxxxxxxxxxxx>
---
 drivers/iio/adc/qcom-spmi-vadc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/qcom-spmi-vadc.c b/drivers/iio/adc/qcom-spmi-vadc.c
index aaf4caf06505..9da3a8fb7514 100644
--- a/drivers/iio/adc/qcom-spmi-vadc.c
+++ b/drivers/iio/adc/qcom-spmi-vadc.c
@@ -664,7 +664,7 @@ static int vadc_scale_die_temp(struct vadc_priv *vadc,
 	if (voltage > 0) {
 		prescale = &vadc_prescale_ratios[prop->prescale];
 		voltage = voltage * prescale->den;
-		voltage /= (prescale->num * 2);
+		do_div(voltage, prescale->num * 2);
 	} else {
 		voltage = 0;
 	}
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux