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]
Message-ID: <SJ0PR03MB6253C3BC80B6B55792409B938E7F9@SJ0PR03MB6253.namprd03.prod.outlook.com>
Date:   Mon, 5 Sep 2022 11:46:39 +0000
From:   "Hennerich, Michael" <Michael.Hennerich@...log.com>
To:     Wei Yongjun <weiyongjun1@...wei.com>,
        Sebastian Reichel <sre@...nel.org>
CC:     "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH -next 2/2] power: supply: adp5061: show unknown
 capacity_level as text



> -----Original Message-----
> From: Wei Yongjun <weiyongjun1@...wei.com>
> Sent: Samstag, 27. August 2022 09:32
> To: Hennerich, Michael <Michael.Hennerich@...log.com>; Sebastian
> Reichel <sre@...nel.org>
> Cc: Wei Yongjun <weiyongjun1@...wei.com>; linux-pm@...r.kernel.org;
> linux-kernel@...r.kernel.org
> Subject: [PATCH -next 2/2] power: supply: adp5061: show unknown
> capacity_level as text
> 
> 
> adp5061_get_battery_status() only defined show chg_status <= 4, others will
> be show as '-1731902199' from /sys/class/power_supply/xx/capacity_level.
> switch to show them as 'Unknown'.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>

Acked-by: Michael Hennerich <michael.hennerich@...log.com>

> ---
>  drivers/power/supply/adp5061.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/power/supply/adp5061.c
> b/drivers/power/supply/adp5061.c index daee1161c305..fcf8ff0bc974
> 100644
> --- a/drivers/power/supply/adp5061.c
> +++ b/drivers/power/supply/adp5061.c
> @@ -493,6 +493,9 @@ static int adp5061_get_battery_status(struct
> adp5061_state *st,
>  	case 0x4: /* VBAT_SNS > VWEAK */
>  		val->intval = POWER_SUPPLY_CAPACITY_LEVEL_NORMAL;
>  		break;
> +	default:
> +		val->intval = POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN;
> +		break;
>  	}
> 
>  	return ret;
> --
> 2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ