Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4493935rdh; Wed, 29 Nov 2023 03:08:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHqef6eyh6spECTNz6mXwnvl/60gPdwqNPjpBIBQ8nvoycHNRWgogHtsSNFZBQQAfRsNIRN X-Received: by 2002:a17:90b:4aca:b0:285:a179:7177 with SMTP id mh10-20020a17090b4aca00b00285a1797177mr15565384pjb.44.1701256127585; Wed, 29 Nov 2023 03:08:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701256127; cv=none; d=google.com; s=arc-20160816; b=d6wQR1Rg9QZoctDqbVdHCE/FwtHQGbA8deDWLmp43d6HJ/DR8cwNGWxiu2kyJSayBv sdI05wfpJxcFd5I/Mv2kryOu9UBTqs+/MIil2UtyFepMk0Xzhacss1Mtd8p9OVOT2lxa QenzaOgsk43u4qeyNm5bO1Y6IoP58z9nuu07TUbZpvS6ogHMpHxY8qNVhiJWNqP5nxRF p5Nbcyj94A5h01Ucbdr6IXOEf8TguCrf6PN4zX4ogedfjvGSBze1MXP3iCyj4ecoeflf ErZl4qpJQYs4WX0GI924U/u0Mrq2BoNinXnzWXgxA1snVup/PSR9JHnpqzoqq52gtWfE 3A/w== 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=pAjtoesAqAijCs4gp3e+t61AnbGpdMOFOh/ep4XxBVn/DaVsUTxyms4IKBF5voj2tR g09rykOj38fK1g98yeqlMyi+tMvq6mTdNTi750FY7N/DPGswRN0wUWNTEAuCeNDNKkem anpha9lBQio4dhUL6ULOoKsZc/KC0cIqPSBY22n8Rk2oc/FyJcz0Isu1iGvLHWNK2Obn dbUB/yD6U6gLz0M8GTWioKLz2ROyOp+RsOY+G85qL27Yo6Jw8YiMHhRPsKpn9ziUjUTX K9QUAcbNN0gwR49+Elcc4w9VDS5shBHWl3vauNFue2n9bXvbbEoINH4x4vK4sQRRJutq PE9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id gv1-20020a17090b11c100b0028014e41ff7si1081829pjb.48.2023.11.29.03.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 03:08:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id B08E880423A5; Wed, 29 Nov 2023 03:08:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231400AbjK2LIF (ORCPT + 99 others); Wed, 29 Nov 2023 06:08:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231351AbjK2LIB (ORCPT ); Wed, 29 Nov 2023 06:08:01 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7531810F0; Wed, 29 Nov 2023 03:08:07 -0800 (PST) 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 667552F4; Wed, 29 Nov 2023 03:08:54 -0800 (PST) Received: from e129166.arm.com (unknown [10.57.4.241]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C95F03F5A1; Wed, 29 Nov 2023 03:08:04 -0800 (PST) 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 v5 02/23] PM: EM: Refactor em_cpufreq_update_efficiencies() arguments Date: Wed, 29 Nov 2023 11:08:32 +0000 Message-Id: <20231129110853.94344-3-lukasz.luba@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231129110853.94344-1-lukasz.luba@arm.com> References: <20231129110853.94344-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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 29 Nov 2023 03:08:43 -0800 (PST) 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