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

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

 



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 <jic23@xxxxxxxxxx>
>> Reported-by: kbuild test robot <fengguang.wu@xxxxxxxxx>
>> Cc: Rama Krishna Phani A <rphani@xxxxxxxxxxxxxx>
> 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@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
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