summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorPerry Yuan <Perry.Yuan@amd.com>2022-08-15 00:35:43 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-08-31 21:05:37 +0200
commit4f59540c3cd00a9a361b2cf2ac475edd83fd4f93 (patch)
tree68e82301e41df3bacf7f737fe05855498567fdbe /drivers/cpufreq
parent45fa44431b336fc2aa5bff01010ed24aee438397 (diff)
downloadlinux-4f59540c3cd00a9a361b2cf2ac475edd83fd4f93.tar.bz2
cpufreq: amd-pstate: simplify cpudata pointer assignment
move the cpudata assignment to cpudata declaration which will simplify the functions. No functional change intended. Reviewed-by: Huang Rui <ray.huang@amd.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Perry Yuan <Perry.Yuan@amd.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/amd-pstate.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 9ac75c1cde9c..2c17623218ec 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -555,9 +555,7 @@ free_cpudata1:
static int amd_pstate_cpu_exit(struct cpufreq_policy *policy)
{
- struct amd_cpudata *cpudata;
-
- cpudata = policy->driver_data;
+ struct amd_cpudata *cpudata = policy->driver_data;
freq_qos_remove_request(&cpudata->req[1]);
freq_qos_remove_request(&cpudata->req[0]);
@@ -599,9 +597,7 @@ static ssize_t show_amd_pstate_max_freq(struct cpufreq_policy *policy,
char *buf)
{
int max_freq;
- struct amd_cpudata *cpudata;
-
- cpudata = policy->driver_data;
+ struct amd_cpudata *cpudata = policy->driver_data;
max_freq = amd_get_max_freq(cpudata);
if (max_freq < 0)
@@ -614,9 +610,7 @@ static ssize_t show_amd_pstate_lowest_nonlinear_freq(struct cpufreq_policy *poli
char *buf)
{
int freq;
- struct amd_cpudata *cpudata;
-
- cpudata = policy->driver_data;
+ struct amd_cpudata *cpudata = policy->driver_data;
freq = amd_get_lowest_nonlinear_freq(cpudata);
if (freq < 0)