From patchwork Thu Aug 10 14:58:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 109813 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2478047qge; Thu, 10 Aug 2017 07:58:48 -0700 (PDT) X-Received: by 10.99.178.86 with SMTP id t22mr12015166pgo.34.1502377127900; Thu, 10 Aug 2017 07:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502377127; cv=none; d=google.com; s=arc-20160816; b=KoLlsoJ27wHND1NlGKxXgs2p/bxSjwi54pMP62jlgfvdP1hzzwvBmKoSfKMcMmkZ1Y mhxsEzSrfBQ7at+sNuuSo1twaM5KhY509C89cY4659zWSGKShHP35AXB9AQZ2hVr1eI4 wU9QDpHjVBRqvvp6TVWL4rR4ooZEbjgc6Mw5ZS66QPORPdZ9uz11bxA9s8ZmV4qx8Lxc KpRu1LeA7DYQWucBGUAHvc7ZTnfKxY9VlDQEKYIslJrG24tMnyiNc5/dakKgDJL8gAHO OZxuCgQ6yTak1AGhDRkCNAdxgecWfuIukJLwiml7sQIbJ1ViL11bVea7Y7h6Qm9z6Xbw ZrlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=N7xBd4a0lEO4RxjxB/dTDiPXWPo7sCW01oBeVOX6kE8=; b=beGbO95N4MkG4p9UicpJYknmPAceDW81Zw6Od0A79jjseEAiRlQDXh56gWU673Nnsp 8Vzxds+6D98LWAzgME98vRoIOjXGXj/Xahs2bF/W+Ly7BgQEYEnKgCbZW0DHyk5ojkUu rJpAeSCuh1c4QiGi0YN8DR52UGd4P284m3FACK1IfwA/pMAgJB7MnFgglcFYIfgCuCbF U2/f1sJdUyFLpXjl0EKrJEaIoYgzSpN5HPtphKlt/IWeosdc1XpsgmJ5AbI8AalgMkZz +6sVAteNRK5EIiYemuWvcjnjjpZ90Bk+boSqO0c8CNLzyJnYWKmq+fk55oEePw04+EUD 1sIg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z65si4827804plh.527.2017.08.10.07.58.47; Thu, 10 Aug 2017 07:58:47 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752059AbdHJO6q (ORCPT + 12 others); Thu, 10 Aug 2017 10:58:46 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:34034 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751972AbdHJO6q (ORCPT ); Thu, 10 Aug 2017 10:58:46 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B837280D; Thu, 10 Aug 2017 07:58:45 -0700 (PDT) Received: from e107155-lin.cambridge.arm.com (unknown [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CC2673F483; Thu, 10 Aug 2017 07:58:44 -0700 (PDT) From: Sudeep Holla To: linux-pm@vger.kernel.org Cc: Sudeep Holla , "Rafael J . Wysocki" , Viresh Kumar Subject: [PATCH] cpufreq: remove setting of policy->cpu in policy->cpus during init Date: Thu, 10 Aug 2017 15:58:57 +0100 Message-Id: <1502377137-9058-1-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org policy->cpu is copied into policy->cpus in cpufreq_online() before calling into cpufreq_driver->init(). So there's no need to set the same in the individual driver init() functions again. This patch removes the redundant setting of policy->cpu in policy->cpus in intel_pstate and cppc drivers. Cc: Rafael J. Wysocki Cc: Viresh Kumar Reported-by: Viresh Kumar Signed-off-by: Sudeep Holla --- drivers/cpufreq/cppc_cpufreq.c | 1 - drivers/cpufreq/intel_pstate.c | 1 - 2 files changed, 2 deletions(-) Hi Viresh, I had copied the cpumask_set_cpu from one of these drivers and when you pointed out I thought it's better to remove the reference too. Let me know if it makes sense. Regards, Sudeep -- 2.7.4 Acked-by: Viresh Kumar diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index 10be285c9055..a1c3025f9df7 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -172,7 +172,6 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy) return -EFAULT; } - cpumask_set_cpu(policy->cpu, policy->cpus); cpu->cur_policy = policy; /* Set policy->cur to max now. The governors will adjust later. */ diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 0566455f233e..d82429859103 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -2133,7 +2133,6 @@ static int __intel_pstate_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.max_freq *= cpu->pstate.scaling; intel_pstate_init_acpi_perf_limits(policy); - cpumask_set_cpu(policy->cpu, policy->cpus); policy->fast_switch_possible = true;