From nobody Fri Dec 19 07:48:00 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8EEAC54EE9 for ; Tue, 13 Sep 2022 14:10:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232656AbiIMOKj (ORCPT ); Tue, 13 Sep 2022 10:10:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232386AbiIMOJP (ORCPT ); Tue, 13 Sep 2022 10:09:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFF995A152; Tue, 13 Sep 2022 07:08:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5CE1A6149A; Tue, 13 Sep 2022 14:08:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33FCEC433C1; Tue, 13 Sep 2022 14:08:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663078134; bh=NyZYEkqcXaZfqxjTZ50hQOYGRdfmSqXY3CvuyG/rMX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CcQHCHDNPjhzKZixtf8K2ti6SIxcK2BCdS/bxRwZt+32kFMzRkJi3JkL+DE+dH4Bm GTJTQYIDDHQupqhlR5BAFbyR+pzWrYJcLhOgDJ4PypkHdwQBSSP4COoz5+062zGNIw eY7ZuPMfF570HsscGh+RjwudLBCWNYcwwEM/kxOA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Viresh Kumar , Lukasz Luba , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.19 026/192] cpufreq: check only freq_table in __resolve_freq() Date: Tue, 13 Sep 2022 16:02:12 +0200 Message-Id: <20220913140411.214707255@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140410.043243217@linuxfoundation.org> References: <20220913140410.043243217@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Lukasz Luba [ Upstream commit 6ca7076fbfaeccce173aeab832d76b9e49e1034b ] There is no need to check if the cpufreq driver implements callback cpufreq_driver::target_index. The logic in the __resolve_freq uses the frequency table available in the policy. It doesn't matter if the driver provides 'target_index' or 'target' callback. It just has to populate the 'policy->freq_table'. Thus, check only frequency table during the frequency resolving call. Acked-by: Viresh Kumar Signed-off-by: Lukasz Luba Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/cpufreq/cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 2cad427741647..f9fd1b6c15d42 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -532,7 +532,7 @@ static unsigned int __resolve_freq(struct cpufreq_polic= y *policy, =20 target_freq =3D clamp_val(target_freq, policy->min, policy->max); =20 - if (!cpufreq_driver->target_index) + if (!policy->freq_table) return target_freq; =20 idx =3D cpufreq_frequency_table_target(policy, target_freq, relation); --=20 2.35.1