summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Medhurst <tixy@linaro.org>2012-08-21 17:50:31 +0100
committerJon Medhurst <tixy@linaro.org>2012-08-21 17:56:53 +0100
commita62bf07fde0ad1156c74398fbe3d8a38874b70f5 (patch)
treeaac0ca18249368a68f6e9330dca96374a73e19a2
parent1205b633aca33562566d362ef3d9f639b08585cb (diff)
ARM: vexpress: Fix range check in idle_debug_set
Clusters are numbered from zero so should be rejected on >= NR_CLUSTERS. Also, we can used unsigned comparisons and avoid testing for < 0. Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r--arch/arm/mach-vexpress/cpuidle-tc2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-vexpress/cpuidle-tc2.c b/arch/arm/mach-vexpress/cpuidle-tc2.c
index 37daf59e27b6..09c0f23acefa 100644
--- a/arch/arm/mach-vexpress/cpuidle-tc2.c
+++ b/arch/arm/mach-vexpress/cpuidle-tc2.c
@@ -194,7 +194,7 @@ static const struct file_operations cpuidle_fops = {
static int idle_debug_set(void *data, u64 val)
{
- if ((val > NR_CLUSTERS || val < 0) && val != 0xff) {
+ if (val >= (unsigned)NR_CLUSTERS && val != 0xff) {
pr_warning("Wrong parameter passed\n");
return -EINVAL;
}