lkml.org 
[lkml]   [2010]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateTue, 11 May 2010 19:25:29 +0200
FromDaniel Mack <>
SubjectRe: [PATCH 3/3] power/ds2760_battery: use factor of 20 for rated_capacity
On Tue, May 11, 2010 at 09:19:24PM +0400, Anton Vorontsov wrote:
> On Tue, May 11, 2010 at 06:38:46PM +0200, Daniel Mack wrote:
> > drivers/power/ds2760_battery.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/power/ds2760_battery.c b/drivers/power/ds2760_battery.c
> > index b82bf92..7b3043f 100644
> > --- a/drivers/power/ds2760_battery.c
> > +++ b/drivers/power/ds2760_battery.c
> > @@ -78,7 +78,7 @@ MODULE_PARM_DESC(current_accum, "current accumulator value");
> >
> > /* Some batteries have their rated capacity stored a N * 10 mAh, while
> > * others use an index into this table. */
> > -#define RATED_CAPACITY_FACTOR 10
> > +#define RATED_CAPACITY_FACTOR 20
>
> I'm a bit worried about this one.
>
> Shouldn't this confuse batteries that already store rated
> capacity with factor of ten? If so, please introduce a module
> option.
>
> Also, you don't update comments and module params description,
> e.g.
>
> MODULE_PARM_DESC(rated_capacity, "rated battery capacity, 10*mAh or index");
> ....
> /* set rated capacity from module param (given in 10 * mAh) */
>
> Is that intentionally?

Well, this parameter doesn't change, and hence the comment is left
untouched. If it is passed as module option, it is interpreted as 10*mAh
and converted to the internal value.

You're right though about your concern about batteries that already
stored a value given in mAh (and not as index) - this will break unless
the module is loaded with a proper module parameter. Don't know whether
this is acceptable.

Daniel


\
 
 \ /
  Last update: 2010-05-12 10:35    [from the cache]
©2003-2010