From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guenter Roeck Date: Mon, 29 Aug 2011 15:06:54 +0000 Subject: Re: [lm-sensors] [PATCH] hwmon: (max16065) Fix current calculation Message-Id: <1314630414.2796.146.camel@groeck-laptop> List-Id: References: <1314563645-12021-1-git-send-email-guenter.roeck@ericsson.com> In-Reply-To: <1314563645-12021-1-git-send-email-guenter.roeck@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lm-sensors@vger.kernel.org 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 > > --- > > 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 > I'd call it embarrassing not to have caught it earlier ... Thanks a lot for the review! Guenter _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors