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: <20160817113141.cshwjvpuwcj2hk5k@earth>
Date:	Wed, 17 Aug 2016 13:31:41 +0200
From:	Sebastian Reichel <sre@...nel.org>
To:	Wenyou Yang <wenyou.yang@...el.com>
Cc:	Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
	David Woodhouse <dwmw2@...radead.org>,
	Rob Herring <robh+dt@...nel.org>,
	Pawel Moll <pawel.moll@....com>,
	Mark Brown <broonie@...nel.org>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	Nicolas Ferre <nicolas.ferre@...el.com>,
	linux-pm@...r.kernel.org
Subject: Re: [PATCH v5 1/7] power: act8945a_charger: Remove
 "battery_temperature"

Hi,

On Tue, Aug 16, 2016 at 04:59:52PM +0800, Wenyou Yang wrote:
> [...]
>
> -static int act8945a_get_battery_health(struct act8945a_charger *charger,
> -				       struct regmap *regmap, int *val)
> +static int act8945a_get_battery_health(struct regmap *regmap, int *val)
>  {
>  	int ret;
>  	unsigned int status;
> @@ -148,7 +146,7 @@ static int act8945a_get_battery_health(struct act8945a_charger *charger,
>  	if (ret < 0)
>  		return ret;
>  
> -	if (charger->battery_temperature && !(status & APCH_STATUS_TEMPDAT))
> +	if (status & APCH_STATUS_TEMPDAT)

This incorrectly inverts the logic.

>  		*val = POWER_SUPPLY_HEALTH_OVERHEAT;
>  	else if (!(status & APCH_STATUS_INDAT))
>  		*val = POWER_SUPPLY_HEALTH_OVERVOLTAGE;
> @@ -188,8 +186,7 @@ static int act8945a_charger_get_property(struct power_supply *psy,
>  		val->intval = POWER_SUPPLY_TECHNOLOGY_LION;
>  		break;
>  	case POWER_SUPPLY_PROP_HEALTH:
> -		ret = act8945a_get_battery_health(charger,
> -						  regmap, &val->intval);
> +		ret = act8945a_get_battery_health(regmap, &val->intval);
>  		break;
>  	case POWER_SUPPLY_PROP_MODEL_NAME:
>  		val->strval = act8945a_charger_model;
> @@ -235,9 +232,6 @@ static int act8945a_charger_config(struct device *dev,
>  		return -EINVAL;
>  	}
>  
> -	charger->battery_temperature = of_property_read_bool(np,
> -				"active-semi,check-battery-temperature");
> -
>  	chglev_pin = of_get_named_gpio_flags(np,
>  				"active-semi,chglev-gpios", 0, &flags);

-- Sebastian

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ