From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: kpark3469@gmail.com
Cc: linux-pm@vger.kernel.org, keun-o.park@windriver.com, len.brown@intel.com
Subject: Re: [PATCH] PM / QOS: correct the valid range of pm_qos_class
Date: Wed, 12 Jun 2013 13:16:42 +0200 [thread overview]
Message-ID: <2687623.rLBRO7ohLp@vostro.rjw.lan> (raw)
In-Reply-To: <1371016395-20688-1-git-send-email-kpark3469@gmail.com>
On Wednesday, June 12, 2013 02:53:15 PM 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 | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/power/qos.c b/kernel/power/qos.c
> index 587ddde..ec6f0a7 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 = 1;
While you're at it, can you please use PM_QOS_CPU_DMA_LATENCY instead of 1
here and below?
Rafael
> 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 >= 1) {
> struct pm_qos_request *req = kzalloc(sizeof(*req), GFP_KERNEL);
> if (!req)
> return -ENOMEM;
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
next prev parent reply other threads:[~2013-06-12 11:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-12 5:53 [PATCH] PM / QOS: correct the valid range of pm_qos_class kpark3469
2013-06-12 11:16 ` Rafael J. Wysocki [this message]
2013-06-13 2:31 kpark3469
2013-07-09 13:29 ` mark gross
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=2687623.rLBRO7ohLp@vostro.rjw.lan \
--to=rjw@sisk.pl \
--cc=keun-o.park@windriver.com \
--cc=kpark3469@gmail.com \
--cc=len.brown@intel.com \
--cc=linux-pm@vger.kernel.org \
/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).