Skip to content

Commit 4f59540

Browse files
Perry Yuanrafaeljw
authored andcommitted
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 <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Perry Yuan <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 45fa444 commit 4f59540

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,7 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy)
555555

556556
static int amd_pstate_cpu_exit(struct cpufreq_policy *policy)
557557
{
558-
struct amd_cpudata *cpudata;
559-
560-
cpudata = policy->driver_data;
558+
struct amd_cpudata *cpudata = policy->driver_data;
561559

562560
freq_qos_remove_request(&cpudata->req[1]);
563561
freq_qos_remove_request(&cpudata->req[0]);
@@ -599,9 +597,7 @@ static ssize_t show_amd_pstate_max_freq(struct cpufreq_policy *policy,
599597
char *buf)
600598
{
601599
int max_freq;
602-
struct amd_cpudata *cpudata;
603-
604-
cpudata = policy->driver_data;
600+
struct amd_cpudata *cpudata = policy->driver_data;
605601

606602
max_freq = amd_get_max_freq(cpudata);
607603
if (max_freq < 0)
@@ -614,9 +610,7 @@ static ssize_t show_amd_pstate_lowest_nonlinear_freq(struct cpufreq_policy *poli
614610
char *buf)
615611
{
616612
int freq;
617-
struct amd_cpudata *cpudata;
618-
619-
cpudata = policy->driver_data;
613+
struct amd_cpudata *cpudata = policy->driver_data;
620614

621615
freq = amd_get_lowest_nonlinear_freq(cpudata);
622616
if (freq < 0)

0 commit comments

Comments
 (0)