Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7843386rdb; Thu, 4 Jan 2024 09:17:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJCGXpdOOQEjtRB67fUQzBEXfCwa6JPOHUHt7P6aSbFBTvhW6+oji8HFV/ife5ZLRb/0f9 X-Received: by 2002:a17:902:ecce:b0:1d4:57b4:7ce with SMTP id a14-20020a170902ecce00b001d457b407cemr878377plh.131.1704388634218; Thu, 04 Jan 2024 09:17:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704388634; cv=none; d=google.com; s=arc-20160816; b=hMUmj3N3kCTJAexT0vAu6JNKzkunRyCT+ecPGlRovV4rdlMTPZNHDVvJVXiHxyQyPG tFhjN656mq+TB6cupHXhr8L5iN7E5Pp6CUzSx8Eg0ybJaV0tedZn7YnMO/Y//es2OsSO 7RtlhV0ApmkJwr/WY8zefQqGtDgVnbcFk2pRzACyGtVgN+0Z+O2zs8pKWEwz23ZU2Acp DGGiHE/zsUDnDo0cq/SA/m7BEtWnPHm+bDiHJf6yNCiReH8Mx9hjRX9kUuc1n/qjjHXA 7U9IJzlQxYk37fNvIvDwOBilX3lYu43MifQ/lV4QKOR+fekVXFGH+97sdL5+pc3aU0G9 2x6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=sO+xFRNTgipgQOKTe/WxvJg41iGrKe4y02ki9gngRd8=; fh=jF+j1UEDAwnYbShW3HmO1TshMsWh36Jt7pSLTP62NeE=; b=xWtcE0gs6x+JwTf9J/3ZDAd0e40aFyGrfMNmaZHJlTY80GR1PYtEyJyH9rRnmVgfEn d4lgQVSDdZNVDBRXUOWB4g+ttprSWS9WSAbzzGBB2yOmo5nPh3roGjvJKh0z/47LdshQ 1VcyeaSxgDTfa/nc4Fvaij06t1qJOF0IQVFkU1US8MJNABVmIZmqi+2GC4DXsOgQ70ID Af6lxs066MhcPrkq6cp3dCSyFiOrc/P4gkA413Ja+0onl4MWlBf8M2lhcFkbmFUEnxjV CeZNKdLUcRTvgmIttbcguyO4JS3CxTFpPqmSWFjH7oqoBJhKTjK8Efqyi4bBXy97wVP5 MEkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-17005-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17005-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q12-20020a170902dacc00b001d4ca32e7cesi4445884plx.538.2024.01.04.09.17.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 09:17:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17005-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-17005-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17005-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3563728853C for ; Thu, 4 Jan 2024 17:17:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7AF9028E0D; Thu, 4 Jan 2024 17:14:57 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BDE5928DD7; Thu, 4 Jan 2024 17:14:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 0B62E153B; Thu, 4 Jan 2024 09:15:41 -0800 (PST) Received: from e129166.arm.com (unknown [10.57.88.128]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 94A6E3F64C; Thu, 4 Jan 2024 09:14:52 -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 v6 02/23] PM: EM: Refactor em_cpufreq_update_efficiencies() arguments Date: Thu, 4 Jan 2024 17:15:32 +0000 Message-Id: <20240104171553.2080674-3-lukasz.luba@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240104171553.2080674-1-lukasz.luba@arm.com> References: <20240104171553.2080674-1-lukasz.luba@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In order to prepare the code for the modifiable EM perf_state table, refactor existing function em_cpufreq_update_efficiencies(). The function now takes the ptr to the EM table as its argument. No functional impact. 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