linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] iio:adc:qcom-spmi-vadc : fix undefined __divdi3
@ 2016-12-30 18:25 Jonathan Cameron
  2016-12-30 18:25 ` [PATCH 2/2] iio:adc:qcom-spmi-vadc silence a long constant warning Jonathan Cameron
  2017-01-08 11:22 ` [PATCH 1/2] iio:adc:qcom-spmi-vadc : fix undefined __divdi3 Jonathan Cameron
  0 siblings, 2 replies; 5+ messages in thread
From: Jonathan Cameron @ 2016-12-30 18:25 UTC (permalink / raw)
  To: linux-iio; +Cc: Jonathan Cameron, Rama Krishna Phani A

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@kernel.org>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Rama Krishna Phani A <rphani@codeaurora.org>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-08 15:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-30 18:25 [PATCH 1/2] iio:adc:qcom-spmi-vadc : fix undefined __divdi3 Jonathan Cameron
2016-12-30 18:25 ` [PATCH 2/2] iio:adc:qcom-spmi-vadc silence a long constant warning Jonathan Cameron
2017-01-08 11:22   ` Jonathan Cameron
2017-01-08 11:22 ` [PATCH 1/2] iio:adc:qcom-spmi-vadc : fix undefined __divdi3 Jonathan Cameron
2017-01-08 15:15   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).