aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSahara <keun-o.park@windriver.com>2013-06-19 22:33:57 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-06-20 18:24:01 -0400
commitd24c2a4f919d17bd1ae4f4010a38ab07ece99cf7 (patch)
tree78ab757e2b4143ef5cc6a7488802634f7378fcda
parent9350de06be45a5a8b927ac6577c9d35de61c90ca (diff)
PM / QoS: correct the valid range of pm_qos_class
The valid start index for pm_qos_array is not 0, but PM_QOS_CPU_DMA_LATENCY. 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. [rjw: Changelog, a bit] Signed-off-by: Sahara <keun-o.park@windriver.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--kernel/power/qos.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/power/qos.c b/kernel/power/qos.c
index 587dddeebf15..f2f5f6e22a3c 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)
477{ 477{
478 int pm_qos_class; 478 int pm_qos_class;
479 479
480 for (pm_qos_class = 0; 480 for (pm_qos_class = PM_QOS_CPU_DMA_LATENCY;
481 pm_qos_class < PM_QOS_NUM_CLASSES; pm_qos_class++) { 481 pm_qos_class < PM_QOS_NUM_CLASSES; pm_qos_class++) {
482 if (minor == 482 if (minor ==
483 pm_qos_array[pm_qos_class]->pm_qos_power_miscdev.minor) 483 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)
491 long pm_qos_class; 491 long pm_qos_class;
492 492
493 pm_qos_class = find_pm_qos_object_by_minor(iminor(inode)); 493 pm_qos_class = find_pm_qos_object_by_minor(iminor(inode));
494 if (pm_qos_class >= 0) { 494 if (pm_qos_class >= PM_QOS_CPU_DMA_LATENCY) {
495 struct pm_qos_request *req = kzalloc(sizeof(*req), GFP_KERNEL); 495 struct pm_qos_request *req = kzalloc(sizeof(*req), GFP_KERNEL);
496 if (!req) 496 if (!req)
497 return -ENOMEM; 497 return -ENOMEM;
@@ -584,7 +584,7 @@ static int __init pm_qos_power_init(void)
584 584
585 BUILD_BUG_ON(ARRAY_SIZE(pm_qos_array) != PM_QOS_NUM_CLASSES); 585 BUILD_BUG_ON(ARRAY_SIZE(pm_qos_array) != PM_QOS_NUM_CLASSES);
586 586
587 for (i = 1; i < PM_QOS_NUM_CLASSES; i++) { 587 for (i = PM_QOS_CPU_DMA_LATENCY; i < PM_QOS_NUM_CLASSES; i++) {
588 ret = register_pm_qos_misc(pm_qos_array[i]); 588 ret = register_pm_qos_misc(pm_qos_array[i]);
589 if (ret < 0) { 589 if (ret < 0) {
590 printk(KERN_ERR "pm_qos_param: %s setup failed\n", 590 printk(KERN_ERR "pm_qos_param: %s setup failed\n",