[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100511174742.GA26871@oksana.dev.rtsoft.ru>
Date: Tue, 11 May 2010 21:47:42 +0400
From: Anton Vorontsov <cbouatmailru@...il.com>
To: Daniel Mack <daniel@...aq.de>
Cc: linux-kernel@...r.kernel.org, Matt Reimer <mreimer@...p.net>,
Evgeniy Polyakov <zbr@...emap.net>, Tejun Heo <tj@...nel.org>,
David Woodhouse <dwmw2@...radead.org>,
Len Brown <len.brown@...el.com>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>
Subject: Re: [PATCH 3/3] power/ds2760_battery: use factor of 20 for
rated_capacity
On Tue, May 11, 2010 at 07:25:29PM +0200, Daniel Mack wrote:
[...]
> > > /* 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.
Unfortunately, it is not. You have to do a run-time option, i.e.
module parameter (you can set up default value for this module
parameter via Kconfig symbol).
--
Anton Vorontsov
email: cbouatmailru@...il.com
irc://irc.freenode.net/bd2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists