From patchwork Mon Mar 13 10:07:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 95199 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp1101059qgd; Mon, 13 Mar 2017 03:09:01 -0700 (PDT) X-Received: by 10.99.5.82 with SMTP id 79mr36002697pgf.8.1489399741439; Mon, 13 Mar 2017 03:09:01 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w27si10992632pgc.348.2017.03.13.03.09.01; Mon, 13 Mar 2017 03:09:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752354AbdCMKIl (ORCPT + 25 others); Mon, 13 Mar 2017 06:08:41 -0400 Received: from mail-pg0-f49.google.com ([74.125.83.49]:36470 "EHLO mail-pg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751565AbdCMKIR (ORCPT ); Mon, 13 Mar 2017 06:08:17 -0400 Received: by mail-pg0-f49.google.com with SMTP id g2so44681652pge.3 for ; Mon, 13 Mar 2017 03:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=kR1yVBZfCdw/d1RR4UdcxsVMYfYxNt8sAGnNWmf5fwU=; b=eMqgilRKghs4JSYDyfjZO9A7Gb3nntYhuZlx/7UCZwtawepEUdEADe0k/uSS7PrNZI fWsFaJQpXn1yTVbI8WPrsbqiFDVq7LPkNG56Swv2TTAens+nEpkw2TlQXNMHSuUgV0BQ PB70V2/aY/R07IrGsvZ+NSoAAz+R72l5yKmmw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=kR1yVBZfCdw/d1RR4UdcxsVMYfYxNt8sAGnNWmf5fwU=; b=WLyDSuYgX1rHUOHCfYTZV0sVA7b/koS7I/sk4db2QIe1cvHitXok1xXYXIHSBF91j/ gkQrSrJyeRds2j1H9he49F+n8wq8TINqB3NCBXuzJJlqWNj60VkJjbdyePb1xlEy+D1O +TgX1hfHOx/YaiGo+X/tYJ72n4X/P+kzSiKDQGh2e4VcE8f1pzickDaa8rYUhRIhitP3 xxN5Dx2/QJxP8i6gS74qpLpDb0+8GpaI05P6z3wKZvrSIo5vQ2M/dzPIRkhzQs6RpHmY SmuHrDyHw+biaGOjKSu8WdSZTMjcBaP1HeH4W0XbT4QlYhMdx7TSpwqNWZdCs1s+n4vG iWEA== X-Gm-Message-State: AMke39lTFzHGFonlv3BpR3bzSh2cFhf9lFjZOKwKu/nhkU2Rmar9QQI262CGPbKPCxSTy1+J X-Received: by 10.84.160.195 with SMTP id v3mr46373794plg.161.1489399695292; Mon, 13 Mar 2017 03:08:15 -0700 (PDT) Received: from localhost ([122.171.239.200]) by smtp.gmail.com with ESMTPSA id p77sm32159709pfj.99.2017.03.13.03.08.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Mar 2017 03:08:14 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , rui.zhang@intel.com, edubezval@gmail.com Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , dan.carpenter@oracle.com, Viresh Kumar Subject: [PATCH V3 1/5] thermal: devfreq: Simplify expression Date: Mon, 13 Mar 2017 15:37:34 +0530 Message-Id: X-Mailer: git-send-email 2.7.1.410.g6faf27b In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no need to check for IS_ERR() as we are looking for a very particular error value here. Drop the first check. Reported-by: Dan Carpenter Signed-off-by: Viresh Kumar Acked-by: Zhang Rui --- drivers/thermal/devfreq_cooling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.1.410.g6faf27b diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c index 7743a78d4723..4793fc7b06dd 100644 --- a/drivers/thermal/devfreq_cooling.c +++ b/drivers/thermal/devfreq_cooling.c @@ -186,7 +186,7 @@ get_static_power(struct devfreq_cooling_device *dfc, unsigned long freq) return 0; opp = dev_pm_opp_find_freq_exact(dev, freq, true); - if (IS_ERR(opp) && (PTR_ERR(opp) == -ERANGE)) + if (PTR_ERR(opp) == -ERANGE) opp = dev_pm_opp_find_freq_exact(dev, freq, false); voltage = dev_pm_opp_get_voltage(opp) / 1000; /* mV */