devfreq_cooling: no need to check state with negative number

We could see that state is defined as unsigned type, so it
should never be less than zero. Let' remove this check.

Signed-off-by: Shawn Lin <[email protected]>
Reviewed-by: Chanwoo Choi <[email protected]>
Signed-off-by: Zhang Rui <[email protected]>
This commit is contained in:
Shawn Lin 2016-08-22 16:08:06 +08:00 • committed by Zhang Rui
commit e3da1cbed6

View file

@ -312,7 +312,7 @@ static int devfreq_cooling_state2power(struct thermal_cooling_device *cdev,
unsigned long freq;
u32 static_power;
if (state < 0 || state >= dfc->freq_table_size)
if (state >= dfc->freq_table_size)
return -EINVAL;
freq = dfc->freq_table[state];