Skip to contentSkip to conversation

cpufreq: Drop unused cpufreq_get_policy()

PATCH In review Rafael J. Wysocki 3 participants 3 messages Apr 10, 2025 CPU frequency scaling framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: Drop unused cpufreq_get_policy()

From: Rafael J. Wysocki <[email protected]>

A recent change has introduced a bug into cpufreq_get_policy(), but this function is not used, so it's better to drop it altogether.

---
 drivers/cpufreq/cpufreq.c |   25 -------------------------
 include/linux/cpufreq.h   |    1 -
 2 files changed, 26 deletions(-)
drivers/cpufreq/cpufreq.c +0 -25
@@ -2549,31 +2549,6 @@
  *                          POLICY INTERFACE                         *
  *********************************************************************/
 
-/**
- * cpufreq_get_policy - get the current cpufreq_policy
- * @policy: struct cpufreq_policy into which the current cpufreq_policy
- *	is written
- * @cpu: CPU to find the policy for
- *
- * Reads the current cpufreq policy.
- */
-int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
-{
-	struct cpufreq_policy *cpu_policy __free(put_cpufreq_policy);
-
-	if (!policy)
-		return -EINVAL;
-
-	cpu_policy = cpufreq_cpu_get(cpu);
-	if (!cpu_policy)
-		return -EINVAL;
-
-	memcpy(policy, cpu_policy, sizeof(*policy));
-
-	return 0;
-}
-EXPORT_SYMBOL(cpufreq_get_policy);
-
 DEFINE_PER_CPU(unsigned long, cpufreq_pressure);
 
 /**
include/linux/cpufreq.h +0 -1
@@ -241,7 +241,6 @@
 
 u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy);
 
-int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
 void refresh_frequency_limits(struct cpufreq_policy *policy);
 void cpufreq_update_policy(unsigned int cpu);
 void cpufreq_update_limits(unsigned int cpu);
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

A recent change has introduced a bug into cpufreq_get_policy(), but this function is not used, so it's better to drop it altogether.

---
 drivers/cpufreq/cpufreq.c |   25 -------------------------
 include/linux/cpufreq.h   |    1 -
 2 files changed, 26 deletions(-)
Signature · 1 line
viresh