iio:adc:qcom-spmi-vadc : fix undefined __divdi3
Subsystems (2)
Jonathan Cameron
maintainerPATCH 1/2 iio:adc:qcom-spmi-vadc : fix undefined __divdi3
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.
--- drivers/iio/adc/qcom-spmi-vadc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/qcom-spmi-vadc.c +1 -1
@@ -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 ; }
Signature · 1 line
2.11.0
Jonathan Cameron
maintainerPATCH 2/2 iio:adc:qcom-spmi-vadc silence a long constant warning.
It is meant to be long and is only added to an s64.
--- drivers/iio/adc/qcom-spmi-vadc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/qcom-spmi-vadc.c +1 -1
@@ -101,7 +101,7 @@#define KELVINMIL_CELSIUSMIL 273150#define PMI_CHG_SCALE_1 -138890 -#define PMI_CHG_SCALE_2 391750000000 +#define PMI_CHG_SCALE_2 391750000000LL#define VADC_CHAN_MIN VADC_USBIN#define VADC_CHAN_MAX VADC_LR_MUX3_BUF_PU1_PU2_XO_THERM
Signature · 1 line
2.11.0
Jonathan Cameron
maintainerRe: [PATCH 2/2] iio:adc:qcom-spmi-vadc silence a long constant warning.
Quoted 4 lines · Jonathan Cameron
It is meant to be long and is only added to an s64.
Signed-off-by Jonathan Cameron <[email protected]>Cc Rama Krishna Phani A <[email protected]>
Applied to the togreg branch of iio.git and pushed out as testing.
Thanks
Jonathan
Quoted 18 lines
--- drivers/iio/adc/qcom-spmi-vadc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/adc/qcom-spmi-vadc.c +1
-1@@ -101,7 +101,7 @@#define KELVINMIL_CELSIUSMIL 273150#define PMI_CHG_SCALE_1 -138890 -#define PMI_CHG_SCALE_2 391750000000 +#define PMI_CHG_SCALE_2 391750000000LL#define VADC_CHAN_MIN VADC_USBIN#define VADC_CHAN_MAX VADC_LR_MUX3_BUF_PU1_PU2_XO_THERM
Jonathan Cameron
maintainerQuoted 7 lines · Jonathan Cameron
A simple
do_divcall 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 <[email protected]>Reported-by kbuild test robot <[email protected]>Cc Rama Krishna Phani A <[email protected]>
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.
Jonathan
Quoted 18 lines
--- drivers/iio/adc/qcom-spmi-vadc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/adc/qcom-spmi-vadc.c +1
-1@@ -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 ; }
Jonathan Cameron
maintainerQuoted 5 lines · Jonathan Cameron
Quoted 4 lines · Jonathan Cameron
A simple
do_divcall works here as all the signed 64 bit is actually small and unsigned at this point, and the numerator is u32.
Quoted 7 lines
Quoted 3 lines
Signed-off-by Jonathan Cameron <[email protected]>Reported-by kbuild test robot <[email protected]>Cc Rama Krishna Phani A <[email protected]>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
Quoted 26 lines
Jonathan
Quoted 10 lines
--- drivers/iio/adc/qcom-spmi-vadc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/adc/qcom-spmi-vadc.c +0
-0drivers/iio/adc/qcom-spmi-vadc.c static int vadc_scale_die_temp(struct vadc_priv *vadc, · line 670
Quoted 8 lines
drivers/iio/adc/qcom-spmi-vadc.c +1
-1@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html