Re: [PATCH] hwmon: (max16065) Fix current calculation

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

 



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@xxxxxxxxxxxx>
> > ---
> > 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@xxxxxxxxxxxx>
> 
I'd call it embarrassing not to have caught it earlier ... 

Thanks a lot for the review!

Guenter



_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors


[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux