[lm-sensors] [PATCH] hwmon: (max16065) Fix current calculation
Guenter Roeck
guenter.roeck at ericsson.com
Mon Aug 29 17:06:54 CEST 2011
On Mon, 2011-08-29 at 05:08 -0400, Jean Delvare wrote:
> On Sun, 28 Aug 2011 13:34:05 -0700, Guenter Roeck wrote:
> > Current calculation is completely wrong. Add missing brackets to fix it.
> >
> > Signed-off-by: Guenter Roeck <guenter.roeck at ericsson.com>
> > ---
> > Candidate for stable (2.6.39+).
> >
> > drivers/hwmon/max16065.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/hwmon/max16065.c b/drivers/hwmon/max16065.c
> > index d94a24f..dd2d7b9 100644
> > --- a/drivers/hwmon/max16065.c
> > +++ b/drivers/hwmon/max16065.c
> > @@ -124,7 +124,7 @@ static inline int MV_TO_LIMIT(int mv, int range)
> >
> > static inline int ADC_TO_CURR(int adc, int gain)
> > {
> > - return adc * 1400000 / gain * 255;
> > + return adc * 1400000 / (gain * 255);
> > }
> >
> > /*
>
> Good catch.
>
> Acked-by: Jean Delvare <khali at linux-fr.org>
>
I'd call it embarrassing not to have caught it earlier ...
Thanks a lot for the review!
Guenter
More information about the lm-sensors
mailing list