From nobody Fri Oct 3 06:35:28 2025 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8988628689B; Thu, 4 Sep 2025 03:22:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756956154; cv=none; b=f+l2guxWgq9hP2EYHUZH79leZBIUYaZFiofXaTeYzqbvVoNTS4p+FuE4NKHcWplyQ59VBI3CwFyVsPXaE46RB8tdJLPzyCuUPSPgMPiJczo/rcnFrY18/WjBMTDjaH6xK1nL1YgzgaLendeGJrvP1lsV6xHrAn4UVRmxPLOBC5E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756956154; c=relaxed/simple; bh=x8Ha1QNaHYQ+8qTLPYLyh2rNfE5Reahj1vCs+A17p3Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bQzx594eOoo/mxbzgf63tSa+nmZ4OPcLINLBwrvAqqAOzYvjty39mBlbKBUkkwt9oQfjCaTPg+TRprKLo5bL1LbHERnuyNqwFpamh1sLHewqcv74jhZ1djA7MHyGyUCbYXIhMp3fl4cCphvWJA8x9ksqZGTd8sBu4PrfIcPtU3U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 5fef6ed8893e11f0b29709d653e92f7d-20250904 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.45,REQID:8c45bc3f-74dc-4aea-a1c4-13172987be29,IP:0,U RL:0,TC:0,Content:29,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:29 X-CID-META: VersionHash:6493067,CLOUDID:56d111a89f763ce905bc7b2f6c1ccb3b,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|850,TC:nil,Content:4|50,EDM:-3 ,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV :0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 5fef6ed8893e11f0b29709d653e92f7d-20250904 Received: from mail.kylinos.cn [(10.44.16.175)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 825392231; Thu, 04 Sep 2025 11:22:23 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 430F3E008FA3; Thu, 4 Sep 2025 11:22:23 +0800 (CST) X-ns-mid: postfix-68B905EF-119253606 Received: from localhost.localdomain (unknown [172.25.120.24]) by mail.kylinos.cn (NSMail) with ESMTPA id 9926FE008FA2; Thu, 4 Sep 2025 11:22:17 +0800 (CST) From: Zihuan Zhang To: "Rafael J . wysocki" , Viresh Kumar , Saravana Kannan Cc: zhenglifeng , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Zihuan Zhang Subject: [PATCH v1 1/3] cpufreq: Drop redundant freq_table parameter Date: Thu, 4 Sep 2025 11:22:08 +0800 Message-Id: <20250904032210.92978-2-zhangzihuan@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250904032210.92978-1-zhangzihuan@kylinos.cn> References: <20250904032210.92978-1-zhangzihuan@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since commit e0b3165ba521 ("cpufreq: add 'freq_table' in struct cpufreq_policy"), freq_table has been stored in struct cpufreq_policy instead of being maintained separately. However, several helpers in freq_table.c still take both policy and freq_table as parameters, even though policy->freq_table can always be used. This leads to redundant function arguments and increases the chance of inconsistencies. This patch removes the unnecessary freq_table argument from these functions and updates their callers to only pass policy. This makes the code simpler, more consistent, and avoids duplication. V2: - Merge three patches into one to fix compile error - simple the check suggested by Viresh Kumar Signed-off-by: Zihuan Zhang Acked-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 2 +- drivers/cpufreq/freq_table.c | 14 ++++++-------- drivers/cpufreq/sh-cpufreq.c | 6 ++---- drivers/cpufreq/virtual-cpufreq.c | 2 +- include/linux/cpufreq.h | 7 +++---- 5 files changed, 13 insertions(+), 18 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index a615c98d80ca..5fcc99f768d2 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2793,7 +2793,7 @@ int cpufreq_boost_set_sw(struct cpufreq_policy *polic= y, int state) if (!policy->freq_table) return -ENXIO; =20 - ret =3D cpufreq_frequency_table_cpuinfo(policy, policy->freq_table); + ret =3D cpufreq_frequency_table_cpuinfo(policy); if (ret) { pr_err("%s: Policy frequency update failed\n", __func__); return ret; diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c index 35de513af6c9..d5111ee56e38 100644 --- a/drivers/cpufreq/freq_table.c +++ b/drivers/cpufreq/freq_table.c @@ -28,10 +28,9 @@ static bool policy_has_boost_freq(struct cpufreq_policy = *policy) return false; } =20 -int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy, - struct cpufreq_frequency_table *table) +int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy) { - struct cpufreq_frequency_table *pos; + struct cpufreq_frequency_table *pos, *table =3D policy->freq_table; unsigned int min_freq =3D ~0; unsigned int max_freq =3D 0; unsigned int freq; @@ -65,10 +64,9 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_polic= y *policy, return 0; } =20 -int cpufreq_frequency_table_verify(struct cpufreq_policy_data *policy, - struct cpufreq_frequency_table *table) +int cpufreq_frequency_table_verify(struct cpufreq_policy_data *policy) { - struct cpufreq_frequency_table *pos; + struct cpufreq_frequency_table *pos, *table =3D policy->freq_table; unsigned int freq, prev_smaller =3D 0; bool found =3D false; =20 @@ -110,7 +108,7 @@ int cpufreq_generic_frequency_table_verify(struct cpufr= eq_policy_data *policy) if (!policy->freq_table) return -ENODEV; =20 - return cpufreq_frequency_table_verify(policy, policy->freq_table); + return cpufreq_frequency_table_verify(policy); } EXPORT_SYMBOL_GPL(cpufreq_generic_frequency_table_verify); =20 @@ -354,7 +352,7 @@ int cpufreq_table_validate_and_sort(struct cpufreq_poli= cy *policy) return 0; } =20 - ret =3D cpufreq_frequency_table_cpuinfo(policy, policy->freq_table); + ret =3D cpufreq_frequency_table_cpuinfo(policy); if (ret) return ret; =20 diff --git a/drivers/cpufreq/sh-cpufreq.c b/drivers/cpufreq/sh-cpufreq.c index 9c0b01e00508..642ddb9ea217 100644 --- a/drivers/cpufreq/sh-cpufreq.c +++ b/drivers/cpufreq/sh-cpufreq.c @@ -89,11 +89,9 @@ static int sh_cpufreq_target(struct cpufreq_policy *poli= cy, static int sh_cpufreq_verify(struct cpufreq_policy_data *policy) { struct clk *cpuclk =3D &per_cpu(sh_cpuclk, policy->cpu); - struct cpufreq_frequency_table *freq_table; =20 - freq_table =3D cpuclk->nr_freqs ? cpuclk->freq_table : NULL; - if (freq_table) - return cpufreq_frequency_table_verify(policy, freq_table); + if (policy->freq_table) + return cpufreq_frequency_table_verify(policy); =20 cpufreq_verify_within_cpu_limits(policy); =20 diff --git a/drivers/cpufreq/virtual-cpufreq.c b/drivers/cpufreq/virtual-cp= ufreq.c index 7dd1b0c263c7..6ffa16d239b2 100644 --- a/drivers/cpufreq/virtual-cpufreq.c +++ b/drivers/cpufreq/virtual-cpufreq.c @@ -250,7 +250,7 @@ static int virt_cpufreq_offline(struct cpufreq_policy *= policy) static int virt_cpufreq_verify_policy(struct cpufreq_policy_data *policy) { if (policy->freq_table) - return cpufreq_frequency_table_verify(policy, policy->freq_table); + return cpufreq_frequency_table_verify(policy); =20 cpufreq_verify_within_cpu_limits(policy); return 0; diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 95f3807c8c55..40966512ea18 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -780,11 +780,10 @@ struct cpufreq_frequency_table { else =20 =20 -int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy, - struct cpufreq_frequency_table *table); +int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy); + +int cpufreq_frequency_table_verify(struct cpufreq_policy_data *policy); =20 -int cpufreq_frequency_table_verify(struct cpufreq_policy_data *policy, - struct cpufreq_frequency_table *table); int cpufreq_generic_frequency_table_verify(struct cpufreq_policy_data *pol= icy); =20 int cpufreq_table_index_unsorted(struct cpufreq_policy *policy, --=20 2.25.1 From nobody Fri Oct 3 06:35:28 2025 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4105023875D; Thu, 4 Sep 2025 03:22:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756956153; cv=none; b=gFAM5W+mcDwR+7htcUYwDi/LPUjZMETb0Il3R0MGHjvtgfEt5NJ0zbayxVBij1Qznb6uSwY9V2xI31btLxjhSMXmO9+QaOGYGjLnXUc05kKZiPxcrGxJajHHGGjCsyxOktxjVfgWDWM7JcuP7jSSCJAgcQIcY8XJ6QCv7MWKwVo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756956153; c=relaxed/simple; bh=y1F4YNY5ia6byEs1gI8SFG6uVecpwsvCj2rNHgXxPJU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=EQbhJIspckJRV/bADvjVwW1HEzOhmL+kC9I5E3mr0GNY30ZtxPABQRq7EpTzoHIW4uD1CDz1ucN0H1AefkgWWyWuZVWCBS82nZqo9mof2J+t5AoH1pLoXqBdvfZ6pJac2FGXGBNdn0na+rV4VK8HDobtgddSxE22HcxDfT3vQsU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 606e5a90893e11f0b29709d653e92f7d-20250904 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.45,REQID:0c47e6c4-b252-4ea7-a1ea-e5084b30ac91,IP:0,U RL:0,TC:0,Content:15,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:15 X-CID-META: VersionHash:6493067,CLOUDID:b4e81299e9a4bbf89f9b3aa19e02cd36,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|850,TC:nil,Content:4|50,EDM:-3 ,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV :0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 606e5a90893e11f0b29709d653e92f7d-20250904 Received: from mail.kylinos.cn [(10.44.16.175)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 1139586264; Thu, 04 Sep 2025 11:22:24 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id F0DD9E008FA2; Thu, 4 Sep 2025 11:22:23 +0800 (CST) X-ns-mid: postfix-68B905EF-844106607 Received: from localhost.localdomain (unknown [172.25.120.24]) by mail.kylinos.cn (NSMail) with ESMTPA id 594EFE008FA4; Thu, 4 Sep 2025 11:22:23 +0800 (CST) From: Zihuan Zhang To: "Rafael J . wysocki" , Viresh Kumar , Saravana Kannan Cc: zhenglifeng , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Zihuan Zhang Subject: [PATCH v1 2/3] cpufreq: Always enforce policy limits even without frequency table Date: Thu, 4 Sep 2025 11:22:09 +0800 Message-Id: <20250904032210.92978-3-zhangzihuan@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250904032210.92978-1-zhangzihuan@kylinos.cn> References: <20250904032210.92978-1-zhangzihuan@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently, cpufreq_frequency_table_verify() simply returns when the driver= =E2=80=99s frequency table is missing (policy->freq_table =3D=3D NULL). This means that cpufreq_verify_within_cpu_limits() is not invoked in such cases, leaving policy->min and policy->max unchecked. Some cpufreq drivers handle this manually by calling cpufreq_verify_within_cpu_limits() even when no frequency table is present, in order to ensure the policy stays within CPU limits. To avoid this inconsistency and potential misuse, make cpufreq_generic_frequency_table_verify() always call cpufreq_verify_within_cpu_limits(), regardless of whether policy->freq_table is available. This unifies the behavior across all drivers and makes the he= lper safe to use universally. Signed-off-by: Zihuan Zhang --- drivers/cpufreq/freq_table.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c index d5111ee56e38..f4b05dcc479b 100644 --- a/drivers/cpufreq/freq_table.c +++ b/drivers/cpufreq/freq_table.c @@ -105,6 +105,7 @@ EXPORT_SYMBOL_GPL(cpufreq_frequency_table_verify); */ int cpufreq_generic_frequency_table_verify(struct cpufreq_policy_data *pol= icy) { + cpufreq_verify_within_cpu_limits(policy); if (!policy->freq_table) return -ENODEV; =20 --=20 2.25.1 From nobody Fri Oct 3 06:35:28 2025 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 035BF3209; Thu, 4 Sep 2025 03:22:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756956155; cv=none; b=I4gIbA/UoE9LNronrVbrpH7nP+E+VorM3KuYo/p6t3/jOHp9tgDHp6SnbkwQVjWcddGve9sl2Ij26B7F+31kBUisL//9ZyATfdEAnr4ab1/zLDUtiUJaiQrPVxuvJxP46X+ZKeyVe+kFoUiwajJsaMppD3oT6WYCA5xoIJVWvR8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756956155; c=relaxed/simple; bh=k0LN+wL4HRHl6TaEJ88+JUFRCRFLfXvr2BjuIXLReHM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YoJjcJpV9l4vY2dohEyUmFhVcl85CTFV1nd0FHmCv6S/iBCiG67yM+B0ZOQkNkfludoUrmdljummoZamHaKRLpQ/1dzc/Ib7jXVKyjPWKq4PWAxZ+sIOwg0g/1veS2JNWSQCUJ61+Uaz7Q9YV3H0MLcuVyLbscsLGW+rsEJqPmU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 609be398893e11f0b29709d653e92f7d-20250904 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.45,REQID:713e5fd1-bb7d-4cfc-b179-ac01170625ac,IP:0,U RL:0,TC:0,Content:28,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:28 X-CID-META: VersionHash:6493067,CLOUDID:1c3f862ab780cee6f3c4f534703e0f60,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|850,TC:nil,Content:4|50,EDM:-3 ,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV :0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 609be398893e11f0b29709d653e92f7d-20250904 Received: from mail.kylinos.cn [(10.44.16.175)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 1138274889; Thu, 04 Sep 2025 11:22:25 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id B375CE008FA5; Thu, 4 Sep 2025 11:22:24 +0800 (CST) X-ns-mid: postfix-68B905F0-562822608 Received: from localhost.localdomain (unknown [172.25.120.24]) by mail.kylinos.cn (NSMail) with ESMTPA id 148D7E008FA3; Thu, 4 Sep 2025 11:22:24 +0800 (CST) From: Zihuan Zhang To: "Rafael J . wysocki" , Viresh Kumar , Saravana Kannan Cc: zhenglifeng , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Zihuan Zhang Subject: [PATCH v1 3/3] cpufreq: Make cpufreq_frequency_table_verify() internal Date: Thu, 4 Sep 2025 11:22:10 +0800 Message-Id: <20250904032210.92978-4-zhangzihuan@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250904032210.92978-1-zhangzihuan@kylinos.cn> References: <20250904032210.92978-1-zhangzihuan@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The helper cpufreq_frequency_table_verify() was previously exported and used directly by a few cpufreq drivers. With the previous change ensuring that cpufreq_generic_frequency_table_verify() always calls cpufreq_verify_within_cpu_limits(), drivers no longer need to call cpufreq_frequency_table_verify() explicitly. Update the affected drivers (sh-cpufreq and virtual-cpufreq) to use cpufreq_generic_frequency_table_verify() instead, and convert cpufreq_frequency_table_verify() to a private static function inside freq_table.c. This reduces the exported cpufreq API surface and enforces a single, consis= tent entry point (cpufreq_generic_frequency_table_verify()) for drivers. No functional changes intended. Signed-off-by: Zihuan Zhang --- drivers/cpufreq/freq_table.c | 5 +---- drivers/cpufreq/sh-cpufreq.c | 6 ++---- drivers/cpufreq/virtual-cpufreq.c | 5 +---- include/linux/cpufreq.h | 2 -- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c index f4b05dcc479b..79fa65aa3859 100644 --- a/drivers/cpufreq/freq_table.c +++ b/drivers/cpufreq/freq_table.c @@ -64,7 +64,7 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy= *policy) return 0; } =20 -int cpufreq_frequency_table_verify(struct cpufreq_policy_data *policy) +static int cpufreq_frequency_table_verify(struct cpufreq_policy_data *poli= cy) { struct cpufreq_frequency_table *pos, *table =3D policy->freq_table; unsigned int freq, prev_smaller =3D 0; @@ -73,8 +73,6 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy_= data *policy) pr_debug("request for verification of policy (%u - %u kHz) for cpu %u\n", policy->min, policy->max, policy->cpu); =20 - cpufreq_verify_within_cpu_limits(policy); - cpufreq_for_each_valid_entry(pos, table) { freq =3D pos->frequency; =20 @@ -97,7 +95,6 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy_= data *policy) =20 return 0; } -EXPORT_SYMBOL_GPL(cpufreq_frequency_table_verify); =20 /* * Generic routine to verify policy & frequency table, requires driver to = set diff --git a/drivers/cpufreq/sh-cpufreq.c b/drivers/cpufreq/sh-cpufreq.c index 642ddb9ea217..ee3fd1e71b90 100644 --- a/drivers/cpufreq/sh-cpufreq.c +++ b/drivers/cpufreq/sh-cpufreq.c @@ -90,10 +90,8 @@ static int sh_cpufreq_verify(struct cpufreq_policy_data = *policy) { struct clk *cpuclk =3D &per_cpu(sh_cpuclk, policy->cpu); =20 - if (policy->freq_table) - return cpufreq_frequency_table_verify(policy); - - cpufreq_verify_within_cpu_limits(policy); + if (!cpufreq_generic_frequency_table_verify(policy)) + return 0; =20 policy->min =3D (clk_round_rate(cpuclk, 1) + 500) / 1000; policy->max =3D (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; diff --git a/drivers/cpufreq/virtual-cpufreq.c b/drivers/cpufreq/virtual-cp= ufreq.c index 6ffa16d239b2..2498f40cd57e 100644 --- a/drivers/cpufreq/virtual-cpufreq.c +++ b/drivers/cpufreq/virtual-cpufreq.c @@ -249,10 +249,7 @@ static int virt_cpufreq_offline(struct cpufreq_policy = *policy) =20 static int virt_cpufreq_verify_policy(struct cpufreq_policy_data *policy) { - if (policy->freq_table) - return cpufreq_frequency_table_verify(policy); - - cpufreq_verify_within_cpu_limits(policy); + cpufreq_generic_frequency_table_verify(policy); return 0; } =20 diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 40966512ea18..577f1cd723a0 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -782,8 +782,6 @@ struct cpufreq_frequency_table { =20 int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy); =20 -int cpufreq_frequency_table_verify(struct cpufreq_policy_data *policy); - int cpufreq_generic_frequency_table_verify(struct cpufreq_policy_data *pol= icy); =20 int cpufreq_table_index_unsorted(struct cpufreq_policy *policy, --=20 2.25.1