* [lm-sensors] [PATCH] hwmon: (max16065) Fix current calculation
@ 2011-08-28 20:34 Guenter Roeck
2011-08-29 9:08 ` Jean Delvare
2011-08-29 15:06 ` Guenter Roeck
0 siblings, 2 replies; 3+ messages in thread
From: Guenter Roeck @ 2011-08-28 20:34 UTC (permalink / raw)
To: lm-sensors
Current calculation is completely wrong. Add missing brackets to fix it.
Signed-off-by: Guenter Roeck <guenter.roeck@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);
}
/*
--
1.7.3.1
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [lm-sensors] [PATCH] hwmon: (max16065) Fix current calculation
2011-08-28 20:34 [lm-sensors] [PATCH] hwmon: (max16065) Fix current calculation Guenter Roeck
@ 2011-08-29 9:08 ` Jean Delvare
2011-08-29 15:06 ` Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2011-08-29 9:08 UTC (permalink / raw)
To: lm-sensors
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@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@linux-fr.org>
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [lm-sensors] [PATCH] hwmon: (max16065) Fix current calculation
2011-08-28 20:34 [lm-sensors] [PATCH] hwmon: (max16065) Fix current calculation Guenter Roeck
2011-08-29 9:08 ` Jean Delvare
@ 2011-08-29 15:06 ` Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2011-08-29 15:06 UTC (permalink / raw)
To: lm-sensors
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@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@linux-fr.org>
>
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-08-29 15:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-28 20:34 [lm-sensors] [PATCH] hwmon: (max16065) Fix current calculation Guenter Roeck
2011-08-29 9:08 ` Jean Delvare
2011-08-29 15:06 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.