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, 18 Jan 2015 11:49:27 +0100
From:	Sebastian Reichel <sre@...nel.org>
To:	Todd E Brandt <todd.e.brandt@...ux.intel.com>
Cc:	linux-pm@...r.kernel.org, linux-iio@...r.kernel.org,
	linux-kernel@...r.kernel.org, jacob.jun.pan@...ux.intel.com,
	sameo@...ux.intel.com, lee.jones@...aro.org, dbaryshkov@...il.com,
	dwmw2@...radead.org, david.woodhouse@...el.com,
	todd.e.brandt@...el.com
Subject: Re: [PATCH 3/3] power/axp288_fuel_gauge: axp288 fuel gauge driver

Hi,

On Wed, Jan 07, 2015 at 01:26:55PM -0800, Todd E Brandt wrote:
> X-Power AXP288 PMIC Fuel Gauge Driver
> 
>  new power_supply driver at driver/power
>  interfaces with the axp20x mfd driver as a cell
>  provides battery info and monitors for changes
>  generates alerts on temperature and capacity issues
> 
> [...]
>
> +static int fuel_gauge_battery_health(struct axp288_fg_info *info)
> +{
> +	int temp, vocv;
> +	int ret, health = POWER_SUPPLY_HEALTH_UNKNOWN;
> +
> +	ret = fuel_gauge_get_btemp(info, &temp);
> +	if (ret < 0)
> +		goto health_read_fail;
> +
> +	ret = fuel_gauge_get_vocv(info, &vocv);
> +	if (ret < 0)
> +		goto health_read_fail;
> +
> +	if (vocv > info->pdata->max_volt)
> +		health = POWER_SUPPLY_HEALTH_OVERVOLTAGE;
> +	else if (temp > info->pdata->max_temp ||
> +			temp < info->pdata->min_temp)
> +		health = POWER_SUPPLY_HEALTH_OVERHEAT;

if (temp < info->pdata->min_temp)
    health = POWER_SUPPLY_HEALTH_COLD;

> +	else if (vocv < info->pdata->min_volt)
> +		health = POWER_SUPPLY_HEALTH_DEAD;
> +	else
> +		health = POWER_SUPPLY_HEALTH_GOOD;
> +
> +health_read_fail:
> +	return health;
> +}
>
> [...]
>
> +static int axp288_fuel_gauge_remove(struct platform_device *pdev)
> +{
> +	return 0;
> +}

You can drop this function if nothing needs to be cleaned, but
that's not the case, so where is the cleanup code?

> [...]

-- 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