Re: [PATCH 8/8] power: bq27xxx_battery: Cleanup health checking

Pali Rohár
2015-07-24T20:53:44Z

[-- Attachment #1: Type: Text/Plain, Size: 743 bytes --]

On Friday 24 July 2015 22:27:39 Andrew F. Davis wrote:
> On 07/23/2015 11:22 AM, Pali Rohár wrote:
> > On Wednesday 22 July 2015 16:52:00 Andrew F. Davis wrote:
> >> + /* Unlikely but important to return first */
> >> + if (bq27xxx_battery_overtemp(di, flags))
> >> + return POWER_SUPPLY_HEALTH_OVERHEAT;
> >> + if (bq27xxx_battery_undertemp(di, flags))
> >> + return POWER_SUPPLY_HEALTH_COLD;
> >> + if (bq27xxx_battery_dead(di, flags))
> >> + return POWER_SUPPLY_HEALTH_DEAD;
> >
> > Good candidates for "if (unlikely(...))" ?
>
> I wasn't sure, but I don't see why not. Added.
>

You wrote "Unlikely" in comment, so I thought that unlikely macro sounds
reasonable here...

--
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]