Return-Path: Received: from saturn.retrosnub.co.uk ([178.18.118.26]:44503 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752407AbdAHPPS (ORCPT ); Sun, 8 Jan 2017 10:15:18 -0500 Subject: Re: [PATCH 1/2] iio:adc:qcom-spmi-vadc : fix undefined __divdi3 To: linux-iio@vger.kernel.org References: <20161230182550.12038-1-jic23@kernel.org> Cc: Rama Krishna Phani A From: Jonathan Cameron Message-ID: <535bfaad-d2b8-1287-1060-d8de656ec645@kernel.org> Date: Sun, 8 Jan 2017 15:15:13 +0000 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Sender: linux-iio-owner@vger.kernel.org List-Id: linux-iio@vger.kernel.org On 08/01/17 11:22, Jonathan Cameron wrote: > On 30/12/16 18:25, Jonathan Cameron wrote: >> 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 >> Reported-by: kbuild test robot >> Cc: Rama Krishna Phani A > Hopefully this is fine. It's holding up my pull request so I'm going to > apply this now. > > Applied to the togreg branch of iio.git and pushed out as testing. and... The autobuilder picked up the fact it was a s64 in the blackfin builds. It is small enough that this doesn't matter so I've added a temporary u64 to do this computation then convert it back again. Rama, if you can possibly test that I haven't messed this up that would be great. I'll run my fix past the build bots again and if it works send out a pull request. The only alternative would be to revert the original patch until this is fixed. Jonathan > > Jonathan >> --- >> 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; >> } >> > > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >