Skip to content

Commit

Permalink
devfreq_cooling: no need to check state with negative number
Browse files Browse the repository at this point in the history
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 <shawn.lin@rock-chips.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
  • Loading branch information
Shawn Lin authored and Zhang Rui committed Sep 27, 2016
1 parent d4b23c5 commit e3da1cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/thermal/devfreq_cooling.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit e3da1cb

Please sign in to comment.