Skip to content

Commit c630458

Browse files
committed
cpufreq/amd-pstate-ut: Adjust variable scope
In amd_pstate_ut_check_freq() and amd_pstate_ut_check_perf() the cpudata variable is only needed in the scope of the for loop. Move it there. Reviewed-by: Gautham R. Shenoy <[email protected]> Reviewed-by: Dhananjay Ugwekar <[email protected]> Signed-off-by: Mario Limonciello <[email protected]>
1 parent 2aac38a commit c630458

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/cpufreq/amd-pstate-ut.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ static int amd_pstate_ut_check_perf(u32 index)
113113
u32 highest_perf = 0, nominal_perf = 0, lowest_nonlinear_perf = 0, lowest_perf = 0;
114114
u64 cap1 = 0;
115115
struct cppc_perf_caps cppc_perf;
116-
struct amd_cpudata *cpudata = NULL;
117116
union perf_cached cur_perf;
118117

119118
for_each_online_cpu(cpu) {
120119
struct cpufreq_policy *policy __free(put_cpufreq_policy) = NULL;
120+
struct amd_cpudata *cpudata;
121121

122122
policy = cpufreq_cpu_get(cpu);
123123
if (!policy)
@@ -186,10 +186,10 @@ static int amd_pstate_ut_check_perf(u32 index)
186186
static int amd_pstate_ut_check_freq(u32 index)
187187
{
188188
int cpu = 0;
189-
struct amd_cpudata *cpudata = NULL;
190189

191190
for_each_online_cpu(cpu) {
192191
struct cpufreq_policy *policy __free(put_cpufreq_policy) = NULL;
192+
struct amd_cpudata *cpudata;
193193

194194
policy = cpufreq_cpu_get(cpu);
195195
if (!policy)

0 commit comments

Comments
 (0)