From patchwork Tue Feb 2 07:32:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 8187301 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6B31EBEEE5 for ; Tue, 2 Feb 2016 07:32:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CBA4E20259 for ; Tue, 2 Feb 2016 07:32:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A20E20254 for ; Tue, 2 Feb 2016 07:32:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753909AbcBBHcP (ORCPT ); Tue, 2 Feb 2016 02:32:15 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:36025 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753873AbcBBHcN (ORCPT ); Tue, 2 Feb 2016 02:32:13 -0500 Received: by mail-pa0-f52.google.com with SMTP id yy13so96503785pab.3; Mon, 01 Feb 2016 23:32:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=INV8cZZm7EUx8VJTb9fQDjySZnGK8CNJy54PTFuveuc=; b=S2ibMCRie4VxpIlkf96S/I9bpv8dWi1iboisAstyKkII21dClhhwcn2tLeKIUsa3TA f8EN/wIVdqubO0ZqzKVGBQf05zRXolNocJg8mvgwwnTpu5VdueXUfy/m1LB2yg7bCKpq 8rcryyRrrul0Emh/w2N1uaToZzs2ZSbULwH0P4bfSJd0X4R9TcX6Ddez7mIBvViU44/n QV9/Ktzegc5i0oM0wxp/olU6QAnqsRciuct2pXIXJ3etlFnWMk3N899u247k03vImb7U 57M8mnoKmMTvFTUv4+eZBMS9x9awzXQ2hwRcGUHxYdMW0zFKbXG4W4nrFFCtzAjCeix9 o0qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=INV8cZZm7EUx8VJTb9fQDjySZnGK8CNJy54PTFuveuc=; b=Q5pWz0omhYlLfkg8s6ReVk7D9Bt9wcOiVUKDkKITDkGVAm4G1UZ0Mx5WqA5UlXpihl iZCJ/B1EOfinHR4ndcdmtgLd4p6XXJDRXacfFU7gKbFvBSvQEeMviLbUA8cuYEk2IamU 2gAbi3JAwKqC5VSz/cxye+G861QfG1Q1zhBTv0Auu71x2zWQJU28bL2w4qMmi18OhxL4 w3wYrgYMSrzeNkPkgVObAE2chBu9Sx4biUf+6ruJLarwEO1mWYkXwW0jRvyzh276zGY3 kiZsHAEh+2IvePqCjgof/cAuQi0NnnU6IzMjZruhgiyg9hz1ANUhMJo7IxjnXDypB4cV YapQ== X-Gm-Message-State: AG10YOSp0oEKj6V2bEZQXZQqbulR8vXQ0/m3OYr110MN81u8pLrPGVxpp0gu5zovXPfSDA== X-Received: by 10.66.150.228 with SMTP id ul4mr45132355pab.15.1454398333153; Mon, 01 Feb 2016 23:32:13 -0800 (PST) Received: from sudip-pc.vectortproxy.org ([183.82.228.136]) by smtp.gmail.com with ESMTPSA id z3sm137260par.17.2016.02.01.23.32.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Feb 2016 23:32:12 -0800 (PST) From: Sudip Mukherjee To: Eduardo Valentin , Zhang Rui Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Sudip Mukherjee Subject: [PATCH] thermal: devfreq_cooling: remove impossible condition Date: Tue, 2 Feb 2016 13:02:06 +0530 Message-Id: <1454398326-5365-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP state is an unsigned long and can never be less than 0. Signed-off-by: Sudip Mukherjee Acked-by: Punit Agrawal --- 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];