From 8c8f77fd0719a079450f59debed4f69ede825adb Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Sun, 21 Feb 2016 00:51:27 +0100 Subject: cpufreq: governor: Move per-CPU data to the common code After previous changes there is only one piece of code in the ondemand governor making references to per-CPU data structures, but it can be easily modified to avoid doing that, so modify it accordingly and move the definition of per-CPU data used by the ondemand and conservative governors to the common code. Next, change that code to access the per-CPU data structures directly rather than via a governor callback. This causes the ->get_cpu_cdbs governor callback to become unnecessary, so drop it along with the macro and function definitions related to it. Finally, drop the definitions of struct od_cpu_dbs_info_s and struct cs_cpu_dbs_info_s that aren't necessary any more. Signed-off-by: Rafael J. Wysocki Acked-by: Viresh Kumar --- drivers/cpufreq/cpufreq_governor.h | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'drivers/cpufreq/cpufreq_governor.h') diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h index 354e0d306ff5..58749da97099 100644 --- a/drivers/cpufreq/cpufreq_governor.h +++ b/drivers/cpufreq/cpufreq_governor.h @@ -41,13 +41,6 @@ /* Ondemand Sampling types */ enum {OD_NORMAL_SAMPLE, OD_SUB_SAMPLE}; -/* create helper routines */ -#define define_get_cpu_dbs_routines(_dbs_info) \ -static struct cpu_dbs_info *get_cpu_cdbs(int cpu) \ -{ \ - return &per_cpu(_dbs_info, cpu).cdbs; \ -} - /* * Abbreviations: * dbs: used as a shortform for demand based switching It helps to keep variable @@ -155,14 +148,6 @@ struct cpu_dbs_info { struct policy_dbs_info *policy_dbs; }; -struct od_cpu_dbs_info_s { - struct cpu_dbs_info cdbs; -}; - -struct cs_cpu_dbs_info_s { - struct cpu_dbs_info cdbs; -}; - /* Per policy Governors sysfs tunables */ struct od_dbs_tuners { unsigned int powersave_bias; @@ -184,7 +169,6 @@ struct dbs_governor { */ struct dbs_data *gdbs_data; - struct cpu_dbs_info *(*get_cpu_cdbs)(int cpu); unsigned int (*gov_dbs_timer)(struct cpufreq_policy *policy); struct policy_dbs_info *(*alloc)(void); void (*free)(struct policy_dbs_info *policy_dbs); @@ -213,5 +197,5 @@ void od_register_powersave_bias_handler(unsigned int (*f) void od_unregister_powersave_bias_handler(void); ssize_t store_sampling_rate(struct dbs_data *dbs_data, const char *buf, size_t count); -void gov_update_cpu_data(struct dbs_governor *gov, struct dbs_data *dbs_data); +void gov_update_cpu_data(struct dbs_data *dbs_data); #endif /* _CPUFREQ_GOVERNOR_H */ -- cgit v1.2.3