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: <m2eg7rbvc2.fsf@baylibre.com>
Date:	Mon, 20 Jun 2016 10:53:33 -0700
From:	Kevin Hilman <khilman@...libre.com>
To:	Sudeep Holla <sudeep.holla@....com>
Cc:	linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
	Ulf Hansson <ulf.hansson@...aro.org>,
	Jon Medhurst <tixy@...aro.org>,
	Mathieu Poirier <mathieu.poirier@...aro.org>,
	Suzuki K Poulose <suzuki.poulose@....com>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>
Subject: Re: [PATCH v2 3/3] firmware: scpi: add device power domain support using genpd

Sudeep Holla <sudeep.holla@....com> writes:

> This patch hooks up the support for device power domain provided by
> SCPI using the Linux generic power domain infrastructure.
>
> Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>
> Cc: Kevin Hilman <khilman@...nel.org>
> Cc: Ulf Hansson <ulf.hansson@...aro.org>
> Cc: linux-pm@...r.kernel.org
> Signed-off-by: Sudeep Holla <sudeep.holla@....com>

[...]

> +static int scpi_pd_power(struct scpi_pm_domain *pd, bool power_on)
> +{
> +	int ret;
> +	enum scpi_power_domain_state state;
> +
> +	if (power_on)
> +		state = SCPI_PD_STATE_ON;
> +	else
> +		state = SCPI_PD_STATE_OFF;
> +
> +	ret = pd->ops->device_set_power_state(pd->domain, state);

There should probably be some sanity checks here that these function
pointers are non-NULL.

> +	if (ret)
> +		return ret;
> +
> +	return !(state == pd->ops->device_get_power_state(pd->domain));
> +}

Kevin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ