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: <20110114152348.GB30831@oksana.dev.rtsoft.ru>
Date:	Fri, 14 Jan 2011 18:23:48 +0300
From:	Anton Vorontsov <cbouatmailru@...il.com>
To:	rklein@...dia.com
Cc:	olof@...om.net, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] power: bq20z75: add support for charge properties

On Thu, Jan 13, 2011 at 10:50:13AM -0800, rklein@...dia.com wrote:
[...]
> +#define PROP_NEEDS_AMPS(PSP) \
> +	((PSP == POWER_SUPPLY_PROP_CHARGE_NOW) || \
> +	 (PSP == POWER_SUPPLY_PROP_CHARGE_FULL) || \
> +	 (PSP == POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN))
> +
> +#define PROP_NEEDS_WATTS(PSP) \
> +	((PSP == POWER_SUPPLY_PROP_ENERGY_NOW) || \
> +	 (PSP == POWER_SUPPLY_PROP_ENERGY_FULL) || \
> +	 (PSP == POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN))

Ugh. Please, implement it as a function.

And maybe place it somewhere into linux/power_supply.h?

Something like this maybe?

static inline bool power_supply_is_amp_prop(enum power_supply_property psp)
{
	switch (psp) {
	case POWER_SUPPLY_PROP_CHARGE_NOW:
	case POWER_SUPPLY_PROP_CHARGE_FULL:
	case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
	<...>
		return 1;
	}
	return 0;
}

Thanks!

-- 
Anton Vorontsov
Email: cbouatmailru@...il.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ