Re: [PATCH 1/2] olpc-battery: Add VOLTAGE_MAX_DESIGN property

From: Anton Vorontsov
Date: Mon Jul 16 2012 - 04:42:24 EST


On Sun, Jul 15, 2012 at 10:43:25PM +0100, Daniel Drake wrote:
> From: Richard A. Smith <richard@xxxxxxxxxx>
>
> upowerd wants to compute the energy in the battery by looking at this
> property. If it's not present then it falls back on using the reported
> voltage of the battery at time upowerd loads. That's close but also
> means that every time you boot you get a slightly different energy
> capacity.
>
> Adding the VOLTAGE_MAX_DESIGN property allows upowerd to compute the
> same energy every time.
>
> Signed-off-by: Richard A. Smith <richard@xxxxxxxxxx>
> Signed-off-by: Daniel Drake <dsd@xxxxxxxxxx>
> ---

Both patches applied, thank you!

[...]
> +static int olpc_bat_get_voltage_max_design(union power_supply_propval *val)
> +{
> + uint8_t ec_byte;
> + union power_supply_propval tech;
> + int ret, mfr;

ret and mfr should have been on separate lines (yes, I understand that
this comes from olpc_bat_get_charge_full_design(), but the function
is the only abuser in the file, so it would be better to fix it, not
spread it further :-)

--
Anton Vorontsov
Email: cbouatmailru@xxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/