linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org,
	linaro-dev@lists.linaro.org, patches@linaro.org, lenb@kernel.org
Subject: Re: [PATCH 2/3] cpuidle : rename function name "__cpuidle_register_driver"
Date: Wed, 19 Sep 2012 22:00:52 +0200	[thread overview]
Message-ID: <505A2474.7090705@linaro.org> (raw)
In-Reply-To: <201209192151.03236.rjw@sisk.pl>

On 09/19/2012 09:51 PM, Rafael J. Wysocki wrote:
> On Wednesday, September 19, 2012, Daniel Lezcano wrote:
>> Clarify the purpose of the function by changing its name and
>> move the condition out of this function.
> Why exactly are you removing the condition?

I just moved the condition out from the function and called it when the
condition is true.

	if (!drv->power_specified)
		set_power_states(drv);


But please, drop this patch too. I noticed there is an overlap with the
next patch I have in my series but not published.

Accidentally I removed "cpuidle_curr_driver = drv;"

Sorry for the inconvenience. Time for me to go to bed :)



>> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
>> ---
>>  drivers/cpuidle/driver.c |   15 ++++++++-------
>>  1 files changed, 8 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c
>> index 40cd3f3..774d2cb 100644
>> --- a/drivers/cpuidle/driver.c
>> +++ b/drivers/cpuidle/driver.c
>> @@ -17,9 +17,10 @@
>>  static struct cpuidle_driver *cpuidle_curr_driver;
>>  DEFINE_SPINLOCK(cpuidle_driver_lock);
>>  
>> -static void __cpuidle_register_driver(struct cpuidle_driver *drv)
>> +static void set_power_states(struct cpuidle_driver *drv)
>>  {
>>  	int i;
>> +
>>  	/*
>>  	 * cpuidle driver should set the drv->power_specified bit
>>  	 * before registering if the driver provides
>> @@ -34,10 +35,8 @@ static void __cpuidle_register_driver(struct cpuidle_driver *drv)
>>  	 * an power value of -1.  So we use -2, -3, etc, for other
>>  	 * c-states.
>>  	 */
>> -	if (!drv->power_specified) {
>> -		for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++)
>> -			drv->states[i].power_usage = -1 - i;
>> -	}
>> +	for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++)
>> +		drv->states[i].power_usage = -1 - i;
>>  }
>>  
>>  
>> @@ -58,8 +57,10 @@ int cpuidle_register_driver(struct cpuidle_driver *drv)
>>  		spin_unlock(&cpuidle_driver_lock);
>>  		return -EBUSY;
>>  	}
>> -	__cpuidle_register_driver(drv);
>> -	cpuidle_curr_driver = drv;
>> +
>> +	if (!drv->power_specified)
>> +		set_power_states(drv);
>> +
>>  	spin_unlock(&cpuidle_driver_lock);
>>  
>>  	return 0;
>>
>
> _______________________________________________
> linaro-dev mailing list
> linaro-dev@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/linaro-dev
>


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-09-19 20:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19 17:22 [PATCH 1/3] cpuidle : remove unused ref count function Daniel Lezcano
2012-09-19 17:22 ` [PATCH 2/3] cpuidle : rename function name "__cpuidle_register_driver" Daniel Lezcano
2012-09-19 19:51   ` Rafael J. Wysocki
2012-09-19 20:00     ` Daniel Lezcano [this message]
2012-09-19 17:22 ` [PATCH 3/3] cpuidle : remove trailing carriage return Daniel Lezcano
2012-09-19 20:16   ` Rafael J. Wysocki
2012-09-19 19:49 ` [PATCH 1/3] cpuidle : remove unused ref count function Rafael J. Wysocki
2012-09-19 19:56   ` Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=505A2474.7090705@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=lenb@kernel.org \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).