public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: mark gross <markgross@thegnar.org>
To: kpark3469@gmail.com
Cc: linux-pm@vger.kernel.org, keun-o.park@windriver.com,
	len.brown@intel.com, rjw@sisk.pl
Subject: Re: [PATCH] PM / QOS: correct the valid range of pm_qos_class
Date: Tue, 9 Jul 2013 06:29:18 -0700	[thread overview]
Message-ID: <20130709132918.GA14761@mgross-G62> (raw)
In-Reply-To: <1371090717-22198-1-git-send-email-kpark3469@gmail.com>

On Thu, Jun 13, 2013 at 11:31:57AM +0900, kpark3469@gmail.com wrote:
> From: Sahara <keun-o.park@windriver.com>
> 
> The valid start index for pm_qos_array is not 0 but 1. There is a
> null_pm_qos at index 0 of pm_qos_array. However, null_pm_qos is not
> created as misc device so that inclusion of 0 index for checking
> pm_qos_class especially for file operations is not proper here.
> 
> Signed-off-by: Sahara <keun-o.park@windriver.com>
> ---
>  kernel/power/qos.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/power/qos.c b/kernel/power/qos.c
> index 587ddde..f2f5f6e 100644
> --- a/kernel/power/qos.c
> +++ b/kernel/power/qos.c
> @@ -477,7 +477,7 @@ static int find_pm_qos_object_by_minor(int minor)
>  {
>  	int pm_qos_class;
>  
> -	for (pm_qos_class = 0;
> +	for (pm_qos_class = PM_QOS_CPU_DMA_LATENCY;
why not: for (pm_qos_class = PM_QOS_RESERVED + 1;?

I don't like assigning symantics implying DMA_LATENCY is the first qos class.
This is implicitly assuming an order I don't think is proper to assume.

humph.  this has already been merged.  My gripe is WRT style anyway.

surves me right for not paying attention. I'll post an stylistic tweak later.

--mark


>  		pm_qos_class < PM_QOS_NUM_CLASSES; pm_qos_class++) {
>  		if (minor ==
>  			pm_qos_array[pm_qos_class]->pm_qos_power_miscdev.minor)
> @@ -491,7 +491,7 @@ static int pm_qos_power_open(struct inode *inode, struct file *filp)
>  	long pm_qos_class;
>  
>  	pm_qos_class = find_pm_qos_object_by_minor(iminor(inode));
> -	if (pm_qos_class >= 0) {
> +	if (pm_qos_class >= PM_QOS_CPU_DMA_LATENCY) {
>  		struct pm_qos_request *req = kzalloc(sizeof(*req), GFP_KERNEL);
>  		if (!req)
>  			return -ENOMEM;
> @@ -584,7 +584,7 @@ static int __init pm_qos_power_init(void)
>  
>  	BUILD_BUG_ON(ARRAY_SIZE(pm_qos_array) != PM_QOS_NUM_CLASSES);
>  
> -	for (i = 1; i < PM_QOS_NUM_CLASSES; i++) {
> +	for (i = PM_QOS_CPU_DMA_LATENCY; i < PM_QOS_NUM_CLASSES; i++) {
>  		ret = register_pm_qos_misc(pm_qos_array[i]);
>  		if (ret < 0) {
>  			printk(KERN_ERR "pm_qos_param: %s setup failed\n",
> -- 
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" 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:[~2013-07-09 13:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-13  2:31 [PATCH] PM / QOS: correct the valid range of pm_qos_class kpark3469
2013-07-09 13:29 ` mark gross [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-06-12  5:53 kpark3469
2013-06-12 11:16 ` Rafael J. Wysocki

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=20130709132918.GA14761@mgross-G62 \
    --to=markgross@thegnar.org \
    --cc=keun-o.park@windriver.com \
    --cc=kpark3469@gmail.com \
    --cc=len.brown@intel.com \
    --cc=linux-pm@vger.kernel.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