Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp405002rdh; Tue, 19 Dec 2023 02:29:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IH//5+ui8ikTMVoA9cj7TwVYbdAZU5u/bydCGLVWX45OFCFQ3EAVg1RdERbh8DyVDiJhWHs X-Received: by 2002:a17:903:234e:b0:1d3:415f:ae9a with SMTP id c14-20020a170903234e00b001d3415fae9amr1276630plh.6.1702981779834; Tue, 19 Dec 2023 02:29:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702981779; cv=none; d=google.com; s=arc-20160816; b=lPWeWi+10oxE9m5oHeU85JMbcyGN+5PxztvEY3t7annAEd+49xpTOi/cGlItqZmyqr 7H+37+nAaMqkXuzpdofO34Vqyzwu9IYcCA99YEW3um7kKb1B9CtrZ7rPxXw85vriP5I1 rum3jJqf5YWxNNXOKKzS0YK0w65isYXwOhZauzPLOmVmtmu6oKkD/KRc/WCFrL08B+et S7ded/7rlGR2ctMXQ8s++UNDDLPUyG0wacYRi/YbPidHAgSYV7/HOQ2DgZwUt0lMFl5m XWf9D/6SXbb60bj1fA/gsQZylVyaHWK6PqHTmseE3yJ/asZlWuKAP13QoChfTYwETA2U yWOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=6bALBxN768+AQqntMzY6D0pzzBPrjcaSBKr+nhF2QgM=; fh=YmW56Jjlaak1EaOYEIddWG8QfZwpR67Ad7p8iQIhC54=; b=e9h3KGjYk75rALAOaXour7uMyEmOqpkWcGptuJDlhDJh6qtDw0/VE/o493KHrsDB+o L8D6NgV3Z6piyhQUyDs3CAyb7TUuMLsZ4sqe/6fOBbYW8lEbJLpNMMX0HEHWx4a5qeaM bhTBrK1xHIAf+0nWomSf954T8bL7+Zp6vtQy2ZMowiB3dGmvqzdtJBhgHh3ziifCW+oi XVnF6tAochmYqWmvSeQ7QStqGF/3+mhV6j25XljGn+qaa3B+s86KU0QDvj+jisD75VMD TySfsUU5BOKlnbOqcgveSr/J8oLjiQLbK6Dx/vvInPJFlXdvTliz76sO5hegblBwLDTM J0EA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-5016-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5016-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. [139.178.88.99]) by mx.google.com with ESMTPS id l16-20020a635b50000000b005cd6df936a9si6603230pgm.601.2023.12.19.02.29.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 02:29:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5016-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-5016-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5016-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 7FB74284AB7 for ; Tue, 19 Dec 2023 10:29:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCAE414AA5; Tue, 19 Dec 2023 10:29:31 +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 834EE14A8F; Tue, 19 Dec 2023 10:29:29 +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 2923D1FB; Tue, 19 Dec 2023 02:30:13 -0800 (PST) Received: from [10.57.85.227] (unknown [10.57.85.227]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A03BB3F738; Tue, 19 Dec 2023 02:29:26 -0800 (PST) Message-ID: <89df2982-5492-43db-8e25-d974ff19fda2@arm.com> Date: Tue, 19 Dec 2023 10:30:32 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 02/23] PM: EM: Refactor em_cpufreq_update_efficiencies() arguments Content-Language: en-US To: Qais Yousef Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rafael@kernel.org, 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, wvw@google.com References: <20231129110853.94344-1-lukasz.luba@arm.com> <20231129110853.94344-3-lukasz.luba@arm.com> <20231217175812.s5vaabxtm4cgil36@airbuntu> From: Lukasz Luba In-Reply-To: <20231217175812.s5vaabxtm4cgil36@airbuntu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/17/23 17:58, Qais Yousef wrote: > On 11/29/23 11:08, Lukasz Luba wrote: >> In order to prepare the code for the modifiable EM perf_state table, >> refactor existing function em_cpufreq_update_efficiencies(). > > nit: What is being refactored here? The description is not adding much info > about the change. The function takes the ptr to the table now as its argument. You have missed that in the code below? > > > Cheers > > -- > Qais Yousef > >> >> 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 >> >