Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp10048410rwr; Fri, 12 May 2023 03:06:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4d78yrDN+KP3Yt0dwCsZX/zXdDARKmLpZZTb9vaXgB+Nc39Ou34I1QwwfE7OPOnuhM35oS X-Received: by 2002:a17:902:ec8c:b0:1a9:80a0:47ef with SMTP id x12-20020a170902ec8c00b001a980a047efmr36368492plg.20.1683885976079; Fri, 12 May 2023 03:06:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683885976; cv=none; d=google.com; s=arc-20160816; b=Wcnv1abQUzwVEOorHIMGdUATwUGaEGUOZCrV2UrEdA8Mpg2fqQrXmaySceFcfd7NMd FCYPfKgtxBKj1JORIJWwaIde59U6r4CxYFsZmEe/7gufG57KxIfDHX/bM2cbxYUtbU4N 35NQQZlRTWCtjOOk5kNXKHiIGk71WxxS8ggR6kyGPzgxieCokFQ0TBosAc/z2/JTn9Xt 2uQ8ogEyxVf+X0LD/Vrng1QjPLv7P9WvtoGg9kloHNSFXihULD/BNeAAeq3u7A7vDxO4 e2F2mk/6IvBz6alvFMkSepqGdodDuLvGmt1d20T1r6Uv1age3mFY+Zd7ycyCQNiZmh9U JJpg== 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=dJ4oD4oEqAaOOiVxKkQkMsMLazgas2uscx+WInoc7Bw=; b=jPJSUZlVDHdFBhlcUrRBkQBMATIvJ8RCyDmI1JiFzjwVd0QQ6g42fF4Z1NZxu0E8/A 4x4HiYh7yFGcnbfyCBf8uAuX7WSoQrmQnlaaoe4YKzACcdXY1GYIbkA6nVeIOTaNrIr7 JgUVnB4GWqS/dH1Fly7Rz2SBgbOgFLRTxHIhpSi5/wZ7K/TTjrTZrVZxQXhxAB8HmdTi jJO1QPFcYZCuO2egl3HQ6RzlS5H5ElZ4cDk5P5d0IubIDzCqYRdKDLCbXZC9t+Ua9fEm 0RndNIlvUtfsp8FdQ5plp1fwuUFfCSFpqWQmT04RWOqpqjpl9VKxaW0YuZDFDdoA7SgI GBwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u15-20020a170902e5cf00b001a9b9c32ab7si9735693plf.624.2023.05.12.03.06.01; Fri, 12 May 2023 03:06:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240428AbjELJ60 (ORCPT + 99 others); Fri, 12 May 2023 05:58:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240591AbjELJ6R (ORCPT ); Fri, 12 May 2023 05:58:17 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ED11811626; Fri, 12 May 2023 02:58:00 -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 23F401063; Fri, 12 May 2023 02:58:45 -0700 (PDT) Received: from e123648.arm.com (unknown [10.57.22.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C9C1C3F5A1; Fri, 12 May 2023 02:57:57 -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, Pierre.Gondois@arm.com, ionela.voinescu@arm.com, rostedt@goodmis.org, mhiramat@kernel.org Subject: [PATCH v2 01/17] PM: EM: Refactor em_cpufreq_update_efficiencies() arguments Date: Fri, 12 May 2023 10:57:27 +0100 Message-Id: <20230512095743.3393563-2-lukasz.luba@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230512095743.3393563-1-lukasz.luba@arm.com> References: <20230512095743.3393563-1-lukasz.luba@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 7b44f5b89fa1..0d037f3c4e58 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