Skip to content

Commit 714d103

Browse files
Lifeng Zhengrafaeljw
authored andcommitted
ACPI: CPPC: Rename cppc_get_perf() to cppc_get_reg_val()
Rename cppc_get_perf() to cppc_get_reg_val() as a generic function to read CPPC registers. Reviewed-by: Pierre Gondois <[email protected]> Signed-off-by: Lifeng Zheng <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 45f3763 commit 714d103

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

drivers/acpi/cppc_acpi.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,16 +1179,16 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)
11791179
return ret_val;
11801180
}
11811181

1182-
static int cppc_get_perf(int cpunum, enum cppc_regs reg_idx, u64 *perf)
1182+
static int cppc_get_reg_val(int cpu, enum cppc_regs reg_idx, u64 *val)
11831183
{
1184-
struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpunum);
1184+
struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpu);
11851185
struct cpc_register_resource *reg;
11861186

1187-
if (perf == NULL)
1187+
if (val == NULL)
11881188
return -EINVAL;
11891189

11901190
if (!cpc_desc) {
1191-
pr_debug("No CPC descriptor for CPU:%d\n", cpunum);
1191+
pr_debug("No CPC descriptor for CPU:%d\n", cpu);
11921192
return -ENODEV;
11931193
}
11941194

@@ -1202,7 +1202,7 @@ static int cppc_get_perf(int cpunum, enum cppc_regs reg_idx, u64 *perf)
12021202
}
12031203

12041204
if (CPC_IN_PCC(reg)) {
1205-
int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpunum);
1205+
int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpu);
12061206
struct cppc_pcc_data *pcc_ss_data = NULL;
12071207
int ret;
12081208

@@ -1216,7 +1216,7 @@ static int cppc_get_perf(int cpunum, enum cppc_regs reg_idx, u64 *perf)
12161216
down_write(&pcc_ss_data->pcc_lock);
12171217

12181218
if (send_pcc_cmd(pcc_ss_id, CMD_READ) >= 0)
1219-
ret = cpc_read(cpunum, reg, perf);
1219+
ret = cpc_read(cpu, reg, val);
12201220
else
12211221
ret = -EIO;
12221222

@@ -1225,7 +1225,7 @@ static int cppc_get_perf(int cpunum, enum cppc_regs reg_idx, u64 *perf)
12251225
return ret;
12261226
}
12271227

1228-
return cpc_read(cpunum, reg, perf);
1228+
return cpc_read(cpu, reg, val);
12291229
}
12301230

12311231
/**
@@ -1237,7 +1237,7 @@ static int cppc_get_perf(int cpunum, enum cppc_regs reg_idx, u64 *perf)
12371237
*/
12381238
int cppc_get_desired_perf(int cpunum, u64 *desired_perf)
12391239
{
1240-
return cppc_get_perf(cpunum, DESIRED_PERF, desired_perf);
1240+
return cppc_get_reg_val(cpunum, DESIRED_PERF, desired_perf);
12411241
}
12421242
EXPORT_SYMBOL_GPL(cppc_get_desired_perf);
12431243

@@ -1250,7 +1250,7 @@ EXPORT_SYMBOL_GPL(cppc_get_desired_perf);
12501250
*/
12511251
int cppc_get_nominal_perf(int cpunum, u64 *nominal_perf)
12521252
{
1253-
return cppc_get_perf(cpunum, NOMINAL_PERF, nominal_perf);
1253+
return cppc_get_reg_val(cpunum, NOMINAL_PERF, nominal_perf);
12541254
}
12551255

12561256
/**
@@ -1262,7 +1262,7 @@ int cppc_get_nominal_perf(int cpunum, u64 *nominal_perf)
12621262
*/
12631263
int cppc_get_highest_perf(int cpunum, u64 *highest_perf)
12641264
{
1265-
return cppc_get_perf(cpunum, HIGHEST_PERF, highest_perf);
1265+
return cppc_get_reg_val(cpunum, HIGHEST_PERF, highest_perf);
12661266
}
12671267
EXPORT_SYMBOL_GPL(cppc_get_highest_perf);
12681268

@@ -1275,7 +1275,7 @@ EXPORT_SYMBOL_GPL(cppc_get_highest_perf);
12751275
*/
12761276
int cppc_get_epp_perf(int cpunum, u64 *epp_perf)
12771277
{
1278-
return cppc_get_perf(cpunum, ENERGY_PERF, epp_perf);
1278+
return cppc_get_reg_val(cpunum, ENERGY_PERF, epp_perf);
12791279
}
12801280
EXPORT_SYMBOL_GPL(cppc_get_epp_perf);
12811281

0 commit comments

Comments
 (0)