lkml.org 
[lkml]   [2014]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] power_supply: bq24261 charger driver
On Wed 2014-01-29 18:53:34, Jenny Tc wrote:
> On Tue, Jan 28, 2014 at 07:14:45AM -0700, Pavel Machek wrote:
> > > +#define BQ24261_ICHRG_MASK (0x1F << 3)
> > > +#define BQ24261_ICHRG_100ma (0x01 << 3)
> > > +#define BQ24261_ICHRG_200ma (0x01 << 4)
> > > +#define BQ24261_ICHRG_400ma (0x01 << 5)
> > > +#define BQ24261_ICHRG_800ma (0x01 << 6)
> > > +#define BQ24261_ICHRG_1600ma (0x01 << 7)
> >
> > First, its mA, not ma.
>
> Camel Case allowed? Ignore Checkpatch.pl warning?

This is not camel case, this is mili ampers.

> > (x/50) << 3, right ?
>
> Few register settings need table mapping, but some can have logic as your
> comment say. Just wanted to keep same logic for all register settings.
> Doesn't it make more readable?

No, it is definitely not readable. Please use logic where you can.

Thanks,
Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


\
 
 \ /
  Last update: 2014-01-29 11:41    [W:0.067 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site