lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 11 Nov 2018 12:30:29 +0100
From:   Pavel Machek <pavel@....cz>
To:     João Paulo Rechi Vita <jprvita@...il.com>
Cc:     "Rafael J . Wysocki" <rjw@...ysocki.net>,
        Len Brown <lenb@...nel.org>,
        Hans de Goede <hdegoede@...hat.com>,
        linux-acpi@...r.kernel.org, Daniel Drake <drake@...lessm.com>,
        Sebastian Reichel <sebastian.reichel@...labora.co.uk>,
        LKML <linux-kernel@...r.kernel.org>, linux@...lessm.com,
        João Paulo Rechi Vita 
        <jprvita@...lessm.com>
Subject: Re: [PATCH] ACPI / battery: Fix reporting "Not charging" when
 capacity is 100%

Hi!

> > >        * was plugged in and the device thus did not start a new charge cycle.
> > >        */
> > >       if ((battery_ac_is_broken || power_supply_is_system_supplied()) &&
> > > -         battery->rate_now == 0)
> > > +         battery->rate_now == 0) {
> > > +             if (battery->capacity_now && battery->full_charge_capacity &&
> > > +                 battery->capacity_now / battery->full_charge_capacity == 1)
> > > +                     return POWER_SUPPLY_STATUS_FULL;
> >
> > Division? Really?

> 
> If you look further down in acpi_battery_get_property, that is how the
> capacity property is calculated. Do you have a better suggestion?

if (battery->capacity_now >= battery->full_charge_capacity)

?
									Pavel

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

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ