From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752885AbcBOSyv (ORCPT ); Mon, 15 Feb 2016 13:54:51 -0500 Received: from lxorguk.ukuu.org.uk ([81.2.110.251]:44804 "EHLO lxorguk.ukuu.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751947AbcBOSyu (ORCPT ); Mon, 15 Feb 2016 13:54:50 -0500 Subject: [PATCH] thermal: remove a pointless check From: Alan To: rui.zhang@intel.com, linux-kernel@vger.kernel.org Date: Mon, 15 Feb 2016 18:54:40 +0000 Message-ID: <20160215185432.27840.73475.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The state in devfreq_cooling_state2power is unsigned so removed the < 0 check. Signed-off-by: Alan Cox --- 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 01f0015..81631b1 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];