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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210116140348.ym75ldaalfadznvb@earth.universe>
Date:   Sat, 16 Jan 2021 15:03:48 +0100
From:   Sebastian Reichel <sebastian.reichel@...labora.com>
To:     angkery <angkery@....com>
Cc:     yangjunlin@...ong.com, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] power: supply: charger-manager: fix the wrong status of
 health

Hi,

On Sat, Jan 16, 2021 at 07:41:20PM +0800, angkery wrote:
> From: Junlin Yang <yangjunlin@...ong.com>
> 
> cm->emergency_stop will only be the value in the enumeration,
> and can not be less than zero, it will get an exception value.
> So replace it with the corresponding value.
> 
> Signed-off-by: Junlin Yang <yangjunlin@...ong.com>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/charger-manager.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
> index 6fcebe4..0d28741 100644
> --- a/drivers/power/supply/charger-manager.c
> +++ b/drivers/power/supply/charger-manager.c
> @@ -723,9 +723,9 @@ static int charger_get_property(struct power_supply *psy,
>  		val->intval = cm->battery_status;
>  		break;
>  	case POWER_SUPPLY_PROP_HEALTH:
> -		if (cm->emergency_stop > 0)
> +		if (cm->emergency_stop == CM_BATT_OVERHEAT)
>  			val->intval = POWER_SUPPLY_HEALTH_OVERHEAT;
> -		else if (cm->emergency_stop < 0)
> +		else if (cm->emergency_stop == CM_BATT_COLD)
>  			val->intval = POWER_SUPPLY_HEALTH_COLD;
>  		else
>  			val->intval = POWER_SUPPLY_HEALTH_GOOD;
> -- 
> 1.9.1
> 
> 

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ