From nobody Sun Dec 14 06:18:52 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 09D3225F7A5; Mon, 1 Sep 2025 11:26:01 +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=1756725965; cv=none; b=gm8ro5pWTEdFnCPdYUvHxNezyMPx6ZFZghlCzrXrpYsBTVHtYephyMUrMAyNku5+RoplMpyp1DG2E1sjje3sCZryX+C0IeaJA2j4/+ZeM664fovYWuTuoou1F3NJ7BtM5q/8tURph0ZVnAO8SXpEhjoBBzVs0JaQQgIBz1ARZlo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756725965; c=relaxed/simple; bh=r37GOsjOSZIAi3ilm/DVvMw2aj8a5AQR+1Ltk6zD+pk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TyxqhMYt/U2rJ9fYZBoBz+70QdHERID3UUc/3RVopihqKdcdEAgPrmeadQAE53bwIlVkUc2KaeybEy0ro+R3VHjIohjClIgKIeDS+tLS9b1TACdz4+UCx86DW4gY5UJ8SQbhvChiGV4oQ6zakNyfNcZdxmE+kXU2A/+9WroXCa0= 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: 6d0a4170872611f0b29709d653e92f7d-20250901 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.45,REQID:f72e906c-0f97-4558-aa3b-b3f507437ee9,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:599e9bb5ca3e0e7a2d8ab39f6015c321,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: 6d0a4170872611f0b29709d653e92f7d-20250901 Received: from mail.kylinos.cn [(10.44.16.175)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 2052718097; Mon, 01 Sep 2025 19:25:55 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 7644CE008FA4; Mon, 1 Sep 2025 19:25:55 +0800 (CST) X-ns-mid: postfix-68B582C3-3435373 Received: from localhost.localdomain (unknown [172.25.120.24]) by mail.kylinos.cn (NSMail) with ESMTPA id E85DDE008FA6; Mon, 1 Sep 2025 19:25:54 +0800 (CST) From: Zihuan Zhang To: "Rafael J . wysocki" , Viresh Kumar 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: Mon, 1 Sep 2025 19:25:49 +0800 Message-Id: <20250901112551.35534-2-zhangzihuan@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250901112551.35534-1-zhangzihuan@kylinos.cn> References: <20250901112551.35534-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. Signed-off-by: Zihuan Zhang --- drivers/cpufreq/cpufreq.c | 2 +- drivers/cpufreq/freq_table.c | 14 ++++++-------- include/linux/cpufreq.h | 7 +++---- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index fc7eace8b65b..76ef82d75ba2 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2792,7 +2792,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/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 Sun Dec 14 06:18:52 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 DC3C5317700; Mon, 1 Sep 2025 11:26:04 +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=1756725966; cv=none; b=Y90S2en5Ct1RpOLGw3P3VpZ4S7K08MOUDId4HBJ33fgHR1HmQFyFbS1ja9pJ5ixTU9uFgb8SrgEDQ4ecSqE3M+OH0bRNUpXz1554pcmfovB3HbaIIfTGvBCWHgnuAJUbqT1k0Y1Pt8NnOPA7iWX9NiB8KxhinmnU6Gq9QhSsrMg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756725966; c=relaxed/simple; bh=yFrHGY4gl+WKtjVwZg7z/fy9wHFND+nRTEy0fProNDk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fuGYrMFWyAHXOnkT9KA456/oHvs+HkXxltUp9L68VMUHS3YV+wSaxMalSl5nm0qmex2fpXdSjyQ3ey3i5UyFeqlQKtclLQOcOEAb1vjTPEW/a3fJN7lQEJQ5Gj5hiEZupOmYCZCJQRLzOgjC1G9h2ho6q/QNyTuiiumhb1e0I90= 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: 6d6d9216872611f0b29709d653e92f7d-20250901 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.45,REQID:144c35c4-4d56-44ab-b343-6fedf74b5f09,IP:0,U RL:0,TC:0,Content:30,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:30 X-CID-META: VersionHash:6493067,CLOUDID:a0527624422494d963e0bfeaab0b4276,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: 6d6d9216872611f0b29709d653e92f7d-20250901 Received: from mail.kylinos.cn [(10.44.16.175)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 1851374865; Mon, 01 Sep 2025 19:25:56 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 1A2FBE008FA4; Mon, 1 Sep 2025 19:25:56 +0800 (CST) X-ns-mid: postfix-68B582C3-9680524 Received: from localhost.localdomain (unknown [172.25.120.24]) by mail.kylinos.cn (NSMail) with ESMTPA id 8C4A5E008FA5; Mon, 1 Sep 2025 19:25:55 +0800 (CST) From: Zihuan Zhang To: "Rafael J . wysocki" , Viresh Kumar Cc: zhenglifeng , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Zihuan Zhang Subject: [PATCH v1 2/3] cpufreq: sh: drop redundant freq_table argument Date: Mon, 1 Sep 2025 19:25:50 +0800 Message-Id: <20250901112551.35534-3-zhangzihuan@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250901112551.35534-1-zhangzihuan@kylinos.cn> References: <20250901112551.35534-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" Previously, some cpufreq core helper functions accepted a separate 'freq_table' argument even though the frequency table is now stored inside struct cpufreq_policy. This patch updates all cpufreq core calls to remove the redundant argument and use policy directly. Signed-off-by: Zihuan Zhang --- drivers/cpufreq/sh-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/sh-cpufreq.c b/drivers/cpufreq/sh-cpufreq.c index 9c0b01e00508..75d224ba56ba 100644 --- a/drivers/cpufreq/sh-cpufreq.c +++ b/drivers/cpufreq/sh-cpufreq.c @@ -93,7 +93,7 @@ static int sh_cpufreq_verify(struct cpufreq_policy_data *= policy) =20 freq_table =3D cpuclk->nr_freqs ? cpuclk->freq_table : NULL; if (freq_table) - return cpufreq_frequency_table_verify(policy, freq_table); + return cpufreq_frequency_table_verify(policy); =20 cpufreq_verify_within_cpu_limits(policy); =20 --=20 2.25.1 From nobody Sun Dec 14 06:18:52 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 352053148B8; Mon, 1 Sep 2025 11:26:03 +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=1756725966; cv=none; b=n0TJWqWVLXRKCxv5pHWWdQt6bhOGuAUTG+IunJT4iMXtP8U493WYGwc4ikQYXeH/wXAC86ymEqbrYwu4FRqrP26UDrh/uCTb1lP9F9FPwoB0czOUWN+FdDadddyBPy2MUR2u6NLq9LuB9Z8GyniybmiTgYAhV8FR5HhJD8s1IBM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756725966; c=relaxed/simple; bh=BXFrM7sEC9cmcb2ejUW+WWFUfN19B5lAYhKHK8zPRGY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=G5G0LceAj5SAuSxnvbGdKG+NcvctvhqYP9N1axoA1jgajKsy1yeZ1w4dlgcIlODnvJYxAr2tz7MBL6J6iCPppnAxlevCzuCjojFn+FCqjEeIF+eQi8VD0ThDG0c/fO8HT07nhZcFTSy/iZAMGJ+eFKsZh4HrgAbyuTJwoUARKDM= 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: 6dcba658872611f0b29709d653e92f7d-20250901 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.45,REQID:080ebc23-0147-47d8-836c-3ca0df44aa07,IP:0,U RL:0,TC:0,Content:30,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:30 X-CID-META: VersionHash:6493067,CLOUDID:6b3849a3a587fda4276d687cb5af7504,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: 6dcba658872611f0b29709d653e92f7d-20250901 Received: from mail.kylinos.cn [(10.44.16.175)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 917678618; Mon, 01 Sep 2025 19:25:56 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id B647AE008FA4; Mon, 1 Sep 2025 19:25:56 +0800 (CST) X-ns-mid: postfix-68B582C4-6041265 Received: from localhost.localdomain (unknown [172.25.120.24]) by mail.kylinos.cn (NSMail) with ESMTPA id 3245AE008FA6; Mon, 1 Sep 2025 19:25:56 +0800 (CST) From: Zihuan Zhang To: "Rafael J . wysocki" , Viresh Kumar Cc: zhenglifeng , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Zihuan Zhang Subject: [PATCH v1 3/3] cpufreq: virtual: drop redundant freq_table argument Date: Mon, 1 Sep 2025 19:25:51 +0800 Message-Id: <20250901112551.35534-4-zhangzihuan@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250901112551.35534-1-zhangzihuan@kylinos.cn> References: <20250901112551.35534-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" Previously, some cpufreq core helper functions accepted a separate 'freq_table' argument even though the frequency table is now stored inside struct cpufreq_policy. This patch updates all cpufreq core calls to remove the redundant argument and use policy directly. Signed-off-by: Zihuan Zhang --- drivers/cpufreq/virtual-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; --=20 2.25.1