summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-01-24 08:51:22 +0000
committerZhang Rui <rui.zhang@intel.com>2013-02-06 13:45:39 +0800
commitc8165dc0ea75855b0bff6e5edbe4957b8a63d021 (patch)
tree680d1af431e53f73b3ae621d03276acbdd7fa4c1
parent3ad9524a15126c24fc37922f56a0fb5dd03c218f (diff)
downloadlinux-3.10-c8165dc0ea75855b0bff6e5edbe4957b8a63d021.tar.gz
linux-3.10-c8165dc0ea75855b0bff6e5edbe4957b8a63d021.tar.bz2
linux-3.10-c8165dc0ea75855b0bff6e5edbe4957b8a63d021.zip
PM: intel_powerclamp: off by one in start_power_clamp()
This value has already been clamped correctly to 0 through 49 in powerclamp_set_cur_state() so this patch doesn't actually change anything. But we should fix it anyway for consistency. set_target_ratio is used as an offset into an array with MAX_TARGET_RATIO (50) elements. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
-rw-r--r--drivers/thermal/intel_powerclamp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/intel_powerclamp.c b/drivers/thermal/intel_powerclamp.c
index a85ff38cb4e..ab3ed907d2c 100644
--- a/drivers/thermal/intel_powerclamp.c
+++ b/drivers/thermal/intel_powerclamp.c
@@ -504,7 +504,7 @@ static int start_power_clamp(void)
return -EINVAL;
}
- set_target_ratio = clamp(set_target_ratio, 0U, MAX_TARGET_RATIO);
+ set_target_ratio = clamp(set_target_ratio, 0U, MAX_TARGET_RATIO - 1);
/* prevent cpu hotplug */
get_online_cpus();