From patchwork Wed Jun 19 11:35:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 167228 Delivered-To: patch@linaro.org Received: by 2002:ac9:6410:0:0:0:0:0 with SMTP id r16csp500861ock; Wed, 19 Jun 2019 04:36:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwK+8E01oc9y/a7qKWnm0D9dy8PU2ZcqDVJoZkQcj6A03mjwba4yBkZlAYslnw/GgVPbTMI X-Received: by 2002:a62:1652:: with SMTP id 79mr61937695pfw.20.1560944176706; Wed, 19 Jun 2019 04:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560944176; cv=none; d=google.com; s=arc-20160816; b=NIvWYcQM1QsPBYFQPrQ7jIcEgeffmxrvX1mGKAOnjdTjswDO61bTWXMWaDiqAC7Uew 1XX2+troqpz3kmO+ljXgAfTF1cU+2MIK32WCvhkCBDJQiNaKWYFaK3VoUk9RzjTb/cmF aRGinEIrB0cT3rYriYwH/Zm3qNpHndLfzXkAon2xraXO9JNxS/Vh2HZOxRr6EBuTYnkF /izXIKFzawPcs1Db7LkDRKDHHz/1Q23xazJpIGgNDNzheAYVgwV+635JYU7yePkz+EmF pzG+Qf6oPh635NlREsP7gBkUqHIndkkI0hCxNyxlY/YvjCay1zqLekrhUefJt7llL9ku mOfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gOLcTvq7r2YFvtxjS8uMzw6EOaoZ+9nef/zKHoqPhZQ=; b=UT1nTNz8/37YLzLOXbicpbR7PevWsB2StLhT+GjVrExKz8S0kjR6ZRi3/5bL9pyy0Q JnL4/IXr6qvvIh3P5yNvaHkfleG9aKh8CdTUSs1A1QgJ0Sayd2U87JmLtZ1yhN3SMJaq S5K8QVssEOcy0uGl7IJD+c/FKrXyuM+2TP392CD+zIfU8wlNUV7fXkBjD61zUd/IO2NI LmI2Ba3Q427P0E9uwyV52mU0Tluy+IkQzwtQkm8M2FjzI2erlWBv+0q5gN7PGI294RMH irEWVziTI3aXNB5LsAbxbJVy4bbAogxNbl7sYSCLI7wEQRZ5H43WRu36KZfwh58p4WD/ 8jWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NcK4VqWs; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s17si1158864pjp.26.2019.06.19.04.36.16; Wed, 19 Jun 2019 04:36:16 -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 header.s=google header.b=NcK4VqWs; 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 S1731717AbfFSLgB (ORCPT + 30 others); Wed, 19 Jun 2019 07:36:01 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:43934 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731706AbfFSLgA (ORCPT ); Wed, 19 Jun 2019 07:36:00 -0400 Received: by mail-pg1-f194.google.com with SMTP id f25so9496465pgv.10 for ; Wed, 19 Jun 2019 04:35:59 -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 :mime-version:content-transfer-encoding; bh=gOLcTvq7r2YFvtxjS8uMzw6EOaoZ+9nef/zKHoqPhZQ=; b=NcK4VqWsbDFm9dietxUlHlc5OUPdr+DQm+9coLpsk4HrrQuKIwtiLCP0nVmCq/4VxJ NYqlr4K3ecz0zAtEiXQxQGhs1ksmfHu8IqjpJen1hRiOwHcGOueF2ef4xdBEL4y3H91i sJnc9IOrjoJ0KUO3Fs+I3UwUByYtjIKZJLeiAEGqpSD886CVu+23TlrogwrN/fhOb/EH zlto37kC+Cvu4LHB5ca+VIAY58mEfPNX3xHmmCoaHMy4SRFHzqKeBeeMT41qTnPn86sr fpKWziov0JvlaRgldzqEQJOoG18VV58hA87r7Qr63dvCjvNF8RWuGWK/KjU2wSOLo7m4 12xg== 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:mime-version:content-transfer-encoding; bh=gOLcTvq7r2YFvtxjS8uMzw6EOaoZ+9nef/zKHoqPhZQ=; b=h2lbXuE/JkHbIMcyAgiHZenMB9LI1nkc/ffDCRYANkYm8eEdvYCk6U9V6OFqmL/zO8 c/DCKslYyy2B3zi+Q2XEMMfH1yWafRi5ncYKbffKlDA9fnAkEibuONFgRGgQWOaKAqXt 72nLMVbh5gb9ZZP/1bc4nH1LzNx9kFuSgvM+W1+snLWIIwa7rKvjhNOUaBZ6O0vJq+as 64t5jXh6WZt/nxDTYQNfV6PFYqz/regOKhiD3Qs4AyVASB9QM1RTObLZ/RNGrAiE+ICb oZZmt6sI9IfRrqaaywIwote7e3wqYTmmHPt8Ri4Rpkj+cQYm+LPLDU5sbdJPEF7lj0Pk rnbQ== X-Gm-Message-State: APjAAAUwu1MLRRgk+BMiY79MQyyd2rca0jEJJWTufUjjGYzmyhwqjr51 kjzBRsQeklKqKU5KktwPisqdxw== X-Received: by 2002:a63:445b:: with SMTP id t27mr7352195pgk.56.1560944159424; Wed, 19 Jun 2019 04:35:59 -0700 (PDT) Received: from localhost ([122.172.66.84]) by smtp.gmail.com with ESMTPSA id 11sm17459849pfo.19.2019.06.19.04.35.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Jun 2019 04:35:59 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org Subject: [PATCH 4/6] cpufreq: Use has_target() instead of !setpolicy Date: Wed, 19 Jun 2019 17:05:40 +0530 Message-Id: <8c563c8f3515ceefd88875160302b6fd472c3dac.1560944014.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b In-Reply-To: References: MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For code consistency, use has_target() instead of !setpolicy everywhere, as it is already done at several places. Maybe we should also use !has_target() for setpolicy case to use only one expression for this differentiation. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.21.0.rc0.269.g1a574e7a288b diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 41ac701e324f..5f5c7a516c74 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -632,7 +632,7 @@ static int cpufreq_parse_policy(char *str_governor, } /** - * cpufreq_parse_governor - parse a governor string only for !setpolicy + * cpufreq_parse_governor - parse a governor string only for has_target() */ static int cpufreq_parse_governor(char *str_governor, struct cpufreq_policy *policy) @@ -1301,7 +1301,7 @@ static int cpufreq_online(unsigned int cpu) policy->max = policy->user_policy.max; } - if (cpufreq_driver->get && !cpufreq_driver->setpolicy) { + if (cpufreq_driver->get && has_target()) { policy->cur = cpufreq_driver->get(policy->cpu); if (!policy->cur) { pr_err("%s: ->get() failed\n", __func__); @@ -2401,7 +2401,7 @@ void cpufreq_update_policy(unsigned int cpu) * BIOS might change freq behind our back * -> ask driver for current freq and notify governors about a change */ - if (cpufreq_driver->get && !cpufreq_driver->setpolicy && + if (cpufreq_driver->get && has_target() && (cpufreq_suspended || WARN_ON(!cpufreq_update_current_freq(policy)))) goto unlock;