From: Shawn Lin Date: Mon, 22 Aug 2016 08:08:06 +0000 (+0800) Subject: devfreq_cooling: no need to check state with negative number X-Git-Tag: v4.9-rc1~36^2~11 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=e3da1cbed64a19babe91775e21fcd8887039e711;p=linux.git 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 Reviewed-by: Chanwoo Choi Signed-off-by: Zhang Rui --- diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c index 01f0015f80dc..81631b110e17 100644 --- a/drivers/thermal/devfreq_cooling.c +++ b/drivers/thermal/devfreq_cooling.c @@ -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];