diff options
author | Sahara <keun-o.park@windriver.com> | 2013-06-20 11:33:57 +0900 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-06-21 00:24:01 +0200 |
commit | d24c2a4f919d17bd1ae4f4010a38ab07ece99cf7 (patch) | |
tree | 78ab757e2b4143ef5cc6a7488802634f7378fcda /kernel | |
parent | 9350de06be45a5a8b927ac6577c9d35de61c90ca (diff) | |
download | op-kernel-dev-d24c2a4f919d17bd1ae4f4010a38ab07ece99cf7.zip op-kernel-dev-d24c2a4f919d17bd1ae4f4010a38ab07ece99cf7.tar.gz |
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | 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; 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", |