Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1051032rdh; Mon, 25 Sep 2023 01:24:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH3j1E+99vDE2c+s46GF9nPWF574r4GPVOoWB870mKShZshziuemvjUnS2DxTD2jzzjU3PW X-Received: by 2002:a17:902:ecd2:b0:1c5:ad14:9095 with SMTP id a18-20020a170902ecd200b001c5ad149095mr4838821plh.64.1695630280900; Mon, 25 Sep 2023 01:24:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695630280; cv=none; d=google.com; s=arc-20160816; b=RDfGSKJ+WGqNCiF1Fzxb7pmkeVPSeSR5zCt43v2qZtqm5jiKQ6p4jjjdR/zHnZbbu3 cXeExUoj27EcAug0u9/tx3bdxhlwHtBtLaIrT5up6BBRDe22H1xh+tWBY7IOm5eW+xXX 4p7zfS97+A2knUS3TxrUMjmdfdPCd5PiIfnfN8zhvbS6BpSAJiU1c7qywHiBEVqm5yFx 07fTG8iUMZFxj5KgT48JuTN3LLcmm2JlxAPuKWVf7Vc4SUxlb30HfOTHkHaDD06voR8F 8BTvK6yf2p9WBk4Gy5LKhRf7EqBcY6zXj9yDwk1dKKe04Bc3BkFO+zAfBLY2nENpFwET vKsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=e9cA+0DkJFR+tPXa3CKCd2sCKzNan0sHKPOnU9erHAE=; fh=jF+j1UEDAwnYbShW3HmO1TshMsWh36Jt7pSLTP62NeE=; b=CGkyH7J81/WtXZOblJUIRWvJY8ztvBt8G7HtdW2GwbtQ5pn6e26FYANgbiudmAcXsA mt45jDDWMLiCa8k4HaXTVM/hALZWn7klmwL8ZXZAgHIq+jAUN6DbM8cNAFEZJoMoaliV NPf4x3fP0Oyyt1Qzc1v8WDWCDVRl8pEdNctjyFPetDO5ORQDWqPCUlJkm15nB/1WNi/t i8JUSC+40gziBPZXTWwPALCLwOsnCYfjLjL63ESKrzHMKZK/TR5k/rs6ny/kkjrBbT64 YSfrZYQNkHUgvaoCIVX8XPm69cuNOH2dCHl6SP90ZZESYnaj17AMSQMn+CLltkGlz4V2 A+Ew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id h11-20020a170902f54b00b001c5f15d24ffsi6708473plf.116.2023.09.25.01.24.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 01:24:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 793C780D6ADD; Mon, 25 Sep 2023 01:11:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232746AbjIYILe (ORCPT + 99 others); Mon, 25 Sep 2023 04:11:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232693AbjIYIL0 (ORCPT ); Mon, 25 Sep 2023 04:11:26 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 00E5CFC; Mon, 25 Sep 2023 01:11:17 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9C4551474; Mon, 25 Sep 2023 01:11:55 -0700 (PDT) Received: from e129166.arm.com (unknown [10.57.93.139]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id F2E633F5A1; Mon, 25 Sep 2023 01:11:14 -0700 (PDT) From: Lukasz Luba To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rafael@kernel.org Cc: lukasz.luba@arm.com, dietmar.eggemann@arm.com, rui.zhang@intel.com, amit.kucheria@verdurent.com, amit.kachhap@gmail.com, daniel.lezcano@linaro.org, viresh.kumar@linaro.org, len.brown@intel.com, pavel@ucw.cz, mhiramat@kernel.org, qyousef@layalina.io, wvw@google.com Subject: [PATCH v4 02/18] PM: EM: Refactor em_cpufreq_update_efficiencies() arguments Date: Mon, 25 Sep 2023 09:11:23 +0100 Message-Id: <20230925081139.1305766-3-lukasz.luba@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230925081139.1305766-1-lukasz.luba@arm.com> References: <20230925081139.1305766-1-lukasz.luba@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 25 Sep 2023 01:11:48 -0700 (PDT) In order to prepare the code for the modifiable EM perf_state table, refactor existing function em_cpufreq_update_efficiencies(). Signed-off-by: Lukasz Luba --- kernel/power/energy_model.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c index 8b9dd4a39f63..42486674b834 100644 --- a/kernel/power/energy_model.c +++ b/kernel/power/energy_model.c @@ -237,10 +237,10 @@ static int em_create_pd(struct device *dev, int nr_states, return 0; } -static void em_cpufreq_update_efficiencies(struct device *dev) +static void +em_cpufreq_update_efficiencies(struct device *dev, struct em_perf_state *table) { struct em_perf_domain *pd = dev->em_pd; - struct em_perf_state *table; struct cpufreq_policy *policy; int found = 0; int i; @@ -254,8 +254,6 @@ static void em_cpufreq_update_efficiencies(struct device *dev) return; } - table = pd->table; - for (i = 0; i < pd->nr_perf_states; i++) { if (!(table[i].flags & EM_PERF_STATE_INEFFICIENT)) continue; @@ -397,7 +395,7 @@ int em_dev_register_perf_domain(struct device *dev, unsigned int nr_states, dev->em_pd->flags |= flags; - em_cpufreq_update_efficiencies(dev); + em_cpufreq_update_efficiencies(dev, dev->em_pd->table); em_debug_create_pd(dev); dev_info(dev, "EM: created perf domain\n"); -- 2.25.1