linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org
Cc: Jonathan Cameron <jic23@kernel.org>,
	Rama Krishna Phani A <rphani@codeaurora.org>
Subject: [PATCH 1/2] iio:adc:qcom-spmi-vadc : fix undefined __divdi3
Date: Fri, 30 Dec 2016 18:25:49 +0000	[thread overview]
Message-ID: <20161230182550.12038-1-jic23@kernel.org> (raw)

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

             reply	other threads:[~2016-12-30 18:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-30 18:25 Jonathan Cameron [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161230182550.12038-1-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=rphani@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).