public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Richard Purdie <rpurdie@rpsys.net>
Cc: lenz@cs.wisc.edu, kernel list <linux-kernel@vger.kernel.org>,
	Russell King <rmk@arm.linux.org.uk>
Subject: Re: More cleanups for sharpsl_pm.c
Date: Mon, 14 Nov 2005 23:05:36 +0100	[thread overview]
Message-ID: <20051114220536.GC13830@elf.ucw.cz> (raw)
In-Reply-To: <1131838003.7597.49.camel@localhost.localdomain>

Hi!

> > sharpsl.c uses macros to hide method calls, in quite a confusing
> > way. This just inlines the macros, so it is easy to see what is going
> > on.
> 
> I'm not totally convinced this makes it easier to read. To me,
> CHARGE_ON(); is more readable than sharpsl_pm.machinfo->charge(1);. Yes,
> you need to look up what the macro does but the names give a fairly good
> idea.

I'm quite convinced it is easier to read...

> ALso, keeping the macros means when I implement the LED trigger for
> charging, I don't have to edit every function in sharpsl_pm but can just
> tweak the header and add an extra level of LED functions. Given that,
> I'd prefer to leave these as they are for now.

...but if this code still changes rapidly, it can probably wait.

> > +/* FIXME:
> > +   why not simply get_percentage, and base it off that?
> > +*/
> >  	if (sharpsl_pm.charge_mode == CHRG_ON) {
> >  		high_thresh = sharpsl_pm.machinfo->status_high_acin;
> >  		low_thresh = sharpsl_pm.machinfo->status_low_acin;
> 
> The percentage curves is likely to change in the future and I doubt
> anyone would remember to update these values. I'd therefore prefer for
> them to be independent of the lookup table.

Well, apm status is not quite critical, right? And if 5% is remaining,
it *is* low battery; if that gets more precise over time, that is
okay.
								Pavel
-- 
Thanks, Sharp!

      reply	other threads:[~2005-11-14 22:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-10 23:56 More cleanups for sharpsl_pm.c Pavel Machek
2005-11-12 23:26 ` Richard Purdie
2005-11-14 22:05   ` Pavel Machek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051114220536.GC13830@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=lenz@cs.wisc.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    --cc=rpurdie@rpsys.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox