From patchwork Mon Feb 6 10:26:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 93394 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1644030qgi; Mon, 6 Feb 2017 02:26:48 -0800 (PST) X-Received: by 10.84.229.13 with SMTP id b13mr16488062plk.175.1486376808912; Mon, 06 Feb 2017 02:26:48 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u22si297436plj.0.2017.02.06.02.26.48; Mon, 06 Feb 2017 02:26:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751494AbdBFK0q (ORCPT + 13 others); Mon, 6 Feb 2017 05:26:46 -0500 Received: from mail-pf0-f172.google.com ([209.85.192.172]:34841 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbdBFK0q (ORCPT ); Mon, 6 Feb 2017 05:26:46 -0500 Received: by mail-pf0-f172.google.com with SMTP id f144so23244648pfa.2 for ; Mon, 06 Feb 2017 02:26:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=qKXEjR8QkRisjKkI6wc7VXROZvkOYHLINPlpeYrW3sg=; b=ZgMtBdgKXYfdCgYkpUOUkHbfuMH2X3T0rLpw694jtqX+sfdHz4TkRIMflBP1rJg+FZ owGdlGrMmsSd8WTwGphCg+sEZdQWucV972jsHsrLGxHiesjDjzXc2nZggcrGZ2qPBTgR XmUNXm05912FLDQGEeuMNbfp9i12hcqgLDR9o= 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; bh=qKXEjR8QkRisjKkI6wc7VXROZvkOYHLINPlpeYrW3sg=; b=JUzbcsBLH3LEzNk8hLO9BlXFz1g/a7NyBMiI8Imad8O2hiQ4R0eSebz/JOPnG0WZaG RhbZIHOYelfdfNJ6/pmzfEiNJQFKsVHzDK+Y1BjuANiR3Xy5/GG/vd1z10ph0+Sz8rs+ VYNoZ/7TpCLRytGQ6qxIfklGvyFL2WKVWyuAPcl3Cipu7jbY0I81kesVPDUFX9jlv6EX DXqV7MNGGxEd4CZFQo2X1zO0laQDSWAqd5LBPNKFR5PPV63w+wzKyhk6fjWhn37DPXhU q7Bx6Psx12oyb1Iak5S1ToJiAPqX7PdPz4ZIpl0qCyYhadWZoe6Jk91HESd9Ouh6EXPB 1QHQ== X-Gm-Message-State: AIkVDXIfTWKb6C7xarHcLCqiSa5j1rvLaoYEVhyxLJ70q3H74X371x4SV81h0Gb/xxG8DMPN X-Received: by 10.98.144.218 with SMTP id q87mr12302443pfk.51.1486376805512; Mon, 06 Feb 2017 02:26:45 -0800 (PST) Received: from localhost ([122.172.165.189]) by smtp.gmail.com with ESMTPSA id j192sm1230633pfc.60.2017.02.06.02.26.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Feb 2017 02:26:44 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Zhang Rui , Eduardo Valentin Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , Viresh Kumar , Dan Carpenter Subject: [PATCH 1/3] thermal: devfreq: Simplify expression Date: Mon, 6 Feb 2017 15:56:27 +0530 Message-Id: <232171cd9d89c2179e10e1f2aed71ad7fc1f7872.1486376756.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.7.1.410.g6faf27b Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 --- drivers/thermal/devfreq_cooling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.1.410.g6faf27b -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c index ba7a5cd994dc..cf71550b9d00 100644 --- a/drivers/thermal/devfreq_cooling.c +++ b/drivers/thermal/devfreq_cooling.c @@ -222,7 +222,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 */