linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio:adc:qcom-spmi-vadc: use div64_s64 instead of direct 64 bit division.
@ 2017-01-08 21:06 Jonathan Cameron
  2017-01-11 17:38 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2017-01-08 21:06 UTC (permalink / raw)
  To: linux-iio; +Cc: Jonathan Cameron, Rama Krishna Phani A

Another one of these that we missed previously which prevents test builds
of this driver on 32 bit platforms as it gives an undefined __divdi3 warning.

Signed-off-by: Jonathan Cameron <jic23@kernel.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 faaf711325b5..0a19761d656c 100644
--- a/drivers/iio/adc/qcom-spmi-vadc.c
+++ b/drivers/iio/adc/qcom-spmi-vadc.c
@@ -641,7 +641,7 @@ static int vadc_scale_therm(struct vadc_priv *vadc,
 	vadc_scale_calib(vadc, adc_code, prop, &voltage);
 
 	if (prop->calibration == VADC_CALIB_ABSOLUTE)
-		voltage /= 1000;
+		voltage = div64_s64(voltage, 1000);
 
 	vadc_map_voltage_temp(adcmap_100k_104ef_104fb,
 			      ARRAY_SIZE(adcmap_100k_104ef_104fb),
-- 
2.11.0


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

* Re: [PATCH] iio:adc:qcom-spmi-vadc: use div64_s64 instead of direct 64 bit division.
  2017-01-08 21:06 [PATCH] iio:adc:qcom-spmi-vadc: use div64_s64 instead of direct 64 bit division Jonathan Cameron
@ 2017-01-11 17:38 ` Jonathan Cameron
  2017-01-19 10:25   ` Phani A, Rama Krishna
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2017-01-11 17:38 UTC (permalink / raw)
  To: linux-iio; +Cc: Rama Krishna Phani A

On 08/01/17 21:06, Jonathan Cameron wrote:
> Another one of these that we missed previously which prevents test builds
> of this driver on 32 bit platforms as it gives an undefined __divdi3 warning.
> 
I'm going to apply (well actually I already did by accident) this
one and send a pull request to Greg.

We are far enough into the cycle that I want to start getting stuff
into linux-next.

Rama, if you get a chance, please do test the 3 patches I've added
to fix up build issues for this driver.

Thanks,

Jonathan
> Signed-off-by: Jonathan Cameron <jic23@kernel.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 faaf711325b5..0a19761d656c 100644
> --- a/drivers/iio/adc/qcom-spmi-vadc.c
> +++ b/drivers/iio/adc/qcom-spmi-vadc.c
> @@ -641,7 +641,7 @@ static int vadc_scale_therm(struct vadc_priv *vadc,
>  	vadc_scale_calib(vadc, adc_code, prop, &voltage);
>  
>  	if (prop->calibration == VADC_CALIB_ABSOLUTE)
> -		voltage /= 1000;
> +		voltage = div64_s64(voltage, 1000);
>  
>  	vadc_map_voltage_temp(adcmap_100k_104ef_104fb,
>  			      ARRAY_SIZE(adcmap_100k_104ef_104fb),
> 


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

* Re: [PATCH] iio:adc:qcom-spmi-vadc: use div64_s64 instead of direct 64 bit division.
  2017-01-11 17:38 ` Jonathan Cameron
@ 2017-01-19 10:25   ` Phani A, Rama Krishna
  0 siblings, 0 replies; 3+ messages in thread
From: Phani A, Rama Krishna @ 2017-01-19 10:25 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio

Hi Jonathan,

Sorry for delayed response.
Verified the patches and are working fine.
Thanks for posting the changes .

Thanks,
Ramakrishna

On 11-Jan-17 11:08 PM, Jonathan Cameron wrote:
> On 08/01/17 21:06, Jonathan Cameron wrote:
>> Another one of these that we missed previously which prevents test builds
>> of this driver on 32 bit platforms as it gives an undefined __divdi3 warning.
>>
> I'm going to apply (well actually I already did by accident) this
> one and send a pull request to Greg.
>
> We are far enough into the cycle that I want to start getting stuff
> into linux-next.
>
> Rama, if you get a chance, please do test the 3 patches I've added
> to fix up build issues for this driver.
>
> Thanks,
>
> Jonathan
>> Signed-off-by: Jonathan Cameron <jic23@kernel.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 faaf711325b5..0a19761d656c 100644
>> --- a/drivers/iio/adc/qcom-spmi-vadc.c
>> +++ b/drivers/iio/adc/qcom-spmi-vadc.c
>> @@ -641,7 +641,7 @@ static int vadc_scale_therm(struct vadc_priv *vadc,
>>  	vadc_scale_calib(vadc, adc_code, prop, &voltage);
>>
>>  	if (prop->calibration == VADC_CALIB_ABSOLUTE)
>> -		voltage /= 1000;
>> +		voltage = div64_s64(voltage, 1000);
>>
>>  	vadc_map_voltage_temp(adcmap_100k_104ef_104fb,
>>  			      ARRAY_SIZE(adcmap_100k_104ef_104fb),
>>
>

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

end of thread, other threads:[~2017-01-19 10:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-08 21:06 [PATCH] iio:adc:qcom-spmi-vadc: use div64_s64 instead of direct 64 bit division Jonathan Cameron
2017-01-11 17:38 ` Jonathan Cameron
2017-01-19 10:25   ` Phani A, Rama Krishna

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