Thread (9 messages) 9 messages, 3 authors, 2016-11-17
STALE3487d
Revisions (2)
  1. rfc [diff vs current]
  2. v1 current

[PATCH 4/4] devfreq_cooling: fix unnecessary check of unsigned long value

From: Lukasz Luba <lukasz.luba@arm.com>
Date: 2016-09-15 14:45:12
Subsystem: the rest, thermal · Maintainers: Linus Torvalds, Rafael J. Wysocki, Daniel Lezcano

This patch changes the unnecessary check 'state < 0', while the state is
unsigned long.

Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
---
 drivers/thermal/devfreq_cooling.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c
index 39f83ce..2e26b49 100644
--- a/drivers/thermal/devfreq_cooling.c
+++ b/drivers/thermal/devfreq_cooling.c
@@ -367,7 +367,7 @@ static int devfreq_cooling_state2power(struct thermal_cooling_device *cdev,
 	u32 static_power;
 	unsigned long dyn_power;
 
-	if (state < 0 || state >= dfc->freq_table_size)
+	if (state >= dfc->freq_table_size)
 		return -EINVAL;
 
 	freq = dfc->freq_table[state];
-- 
2.9.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help