Skip to content

Commit

Permalink
cpufreq: Convert printk(KERN_<LEVEL> to pr_<level>
Browse files Browse the repository at this point in the history
Use the more common logging style.

Miscellanea:

o Coalesce formats
o Realign arguments
o Add a missing space between a coalesced format

Signed-off-by: Joe Perches <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
JoePerches authored and rafaeljw committed Apr 8, 2016
1 parent 4836df1 commit b49c22a
Show file tree
Hide file tree
Showing 25 changed files with 199 additions and 265 deletions.
10 changes: 3 additions & 7 deletions drivers/cpufreq/acpi-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,10 +648,7 @@ static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c)
if ((c->x86 == 15) &&
(c->x86_model == 6) &&
(c->x86_mask == 8)) {
printk(KERN_INFO "acpi-cpufreq: Intel(R) "
"Xeon(R) 7100 Errata AL30, processors may "
"lock up on frequency changes: disabling "
"acpi-cpufreq.\n");
pr_info("acpi-cpufreq: Intel(R) Xeon(R) 7100 Errata AL30, processors may lock up on frequency changes: disabling acpi-cpufreq\n");
return -ENODEV;
}
}
Expand Down Expand Up @@ -799,8 +796,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
if (perf->control_register.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE &&
policy->cpuinfo.transition_latency > 20 * 1000) {
policy->cpuinfo.transition_latency = 20 * 1000;
printk_once(KERN_INFO
"P-state transition latency capped at 20 uS\n");
pr_info_once("P-state transition latency capped at 20 uS\n");
}

/* table init */
Expand All @@ -822,7 +818,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
goto err_freqfree;

if (perf->states[0].core_frequency * 1000 != policy->cpuinfo.max_freq)
printk(KERN_WARNING FW_WARN "P-state 0 is not max freq\n");
pr_warn(FW_WARN "P-state 0 is not max freq\n");

switch (perf->control_register.space_id) {
case ACPI_ADR_SPACE_SYSTEM_IO:
Expand Down
24 changes: 10 additions & 14 deletions drivers/cpufreq/cpufreq-nforce2.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ static int nforce2_set_fsb(unsigned int fsb)
int pll = 0;

if ((fsb > max_fsb) || (fsb < NFORCE2_MIN_FSB)) {
printk(KERN_ERR PFX "FSB %d is out of range!\n", fsb);
pr_err(PFX "FSB %d is out of range!\n", fsb);
return -EINVAL;
}

tfsb = nforce2_fsb_read(0);
if (!tfsb) {
printk(KERN_ERR PFX "Error while reading the FSB\n");
pr_err(PFX "Error while reading the FSB\n");
return -EINVAL;
}

Expand Down Expand Up @@ -276,8 +276,7 @@ static int nforce2_target(struct cpufreq_policy *policy,
/* local_irq_save(flags); */

if (nforce2_set_fsb(target_fsb) < 0)
printk(KERN_ERR PFX "Changing FSB to %d failed\n",
target_fsb);
pr_err(PFX "Changing FSB to %d failed\n", target_fsb);
else
pr_debug("Changed FSB successfully to %d\n",
target_fsb);
Expand Down Expand Up @@ -325,8 +324,7 @@ static int nforce2_cpu_init(struct cpufreq_policy *policy)
/* FIX: Get FID from CPU */
if (!fid) {
if (!cpu_khz) {
printk(KERN_WARNING PFX
"cpu_khz not set, can't calculate multiplier!\n");
pr_warn(PFX "cpu_khz not set, can't calculate multiplier!\n");
return -ENODEV;
}

Expand All @@ -341,8 +339,8 @@ static int nforce2_cpu_init(struct cpufreq_policy *policy)
}
}

printk(KERN_INFO PFX "FSB currently at %i MHz, FID %d.%d\n", fsb,
fid / 10, fid % 10);
pr_info(PFX "FSB currently at %i MHz, FID %d.%d\n",
fsb, fid / 10, fid % 10);

/* Set maximum FSB to FSB at boot time */
max_fsb = nforce2_fsb_read(1);
Expand Down Expand Up @@ -401,11 +399,9 @@ static int nforce2_detect_chipset(void)
if (nforce2_dev == NULL)
return -ENODEV;

printk(KERN_INFO PFX "Detected nForce2 chipset revision %X\n",
nforce2_dev->revision);
printk(KERN_INFO PFX
"FSB changing is maybe unstable and can lead to "
"crashes and data loss.\n");
pr_info(PFX "Detected nForce2 chipset revision %X\n",
nforce2_dev->revision);
pr_info(PFX "FSB changing is maybe unstable and can lead to crashes and data loss\n");

return 0;
}
Expand All @@ -423,7 +419,7 @@ static int __init nforce2_init(void)

/* detect chipset */
if (nforce2_detect_chipset()) {
printk(KERN_INFO PFX "No nForce2 chipset.\n");
pr_info(PFX "No nForce2 chipset\n");
return -ENODEV;
}

Expand Down
60 changes: 25 additions & 35 deletions drivers/cpufreq/e_powersaver.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,9 @@ static int eps_set_state(struct eps_cpu_data *centaur,
/* Print voltage and multiplier */
rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
current_voltage = lo & 0xff;
printk(KERN_INFO "eps: Current voltage = %dmV\n",
current_voltage * 16 + 700);
pr_info("eps: Current voltage = %dmV\n", current_voltage * 16 + 700);
current_multiplier = (lo >> 8) & 0xff;
printk(KERN_INFO "eps: Current multiplier = %d\n",
current_multiplier);
pr_info("eps: Current multiplier = %d\n", current_multiplier);
}
#endif
return 0;
Expand All @@ -166,7 +164,7 @@ static int eps_target(struct cpufreq_policy *policy, unsigned int index)
dest_state = centaur->freq_table[index].driver_data & 0xffff;
ret = eps_set_state(centaur, policy, dest_state);
if (ret)
printk(KERN_ERR "eps: Timeout!\n");
pr_err("eps: Timeout!\n");
return ret;
}

Expand Down Expand Up @@ -194,36 +192,36 @@ static int eps_cpu_init(struct cpufreq_policy *policy)
return -ENODEV;

/* Check brand */
printk(KERN_INFO "eps: Detected VIA ");
pr_info("eps: Detected VIA ");

switch (c->x86_model) {
case 10:
rdmsr(0x1153, lo, hi);
brand = (((lo >> 2) ^ lo) >> 18) & 3;
printk(KERN_CONT "Model A ");
pr_cont("Model A ");
break;
case 13:
rdmsr(0x1154, lo, hi);
brand = (((lo >> 4) ^ (lo >> 2))) & 0x000000ff;
printk(KERN_CONT "Model D ");
pr_cont("Model D ");
break;
}

switch (brand) {
case EPS_BRAND_C7M:
printk(KERN_CONT "C7-M\n");
pr_cont("C7-M\n");
break;
case EPS_BRAND_C7:
printk(KERN_CONT "C7\n");
pr_cont("C7\n");
break;
case EPS_BRAND_EDEN:
printk(KERN_CONT "Eden\n");
pr_cont("Eden\n");
break;
case EPS_BRAND_C7D:
printk(KERN_CONT "C7-D\n");
pr_cont("C7-D\n");
break;
case EPS_BRAND_C3:
printk(KERN_CONT "C3\n");
pr_cont("C3\n");
return -ENODEV;
break;
}
Expand All @@ -235,30 +233,27 @@ static int eps_cpu_init(struct cpufreq_policy *policy)
/* Can be locked at 0 */
rdmsrl(MSR_IA32_MISC_ENABLE, val);
if (!(val & MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP)) {
printk(KERN_INFO "eps: Can't enable Enhanced PowerSaver\n");
pr_info("eps: Can't enable Enhanced PowerSaver\n");
return -ENODEV;
}
}

/* Print voltage and multiplier */
rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
current_voltage = lo & 0xff;
printk(KERN_INFO "eps: Current voltage = %dmV\n",
current_voltage * 16 + 700);
pr_info("eps: Current voltage = %dmV\n", current_voltage * 16 + 700);
current_multiplier = (lo >> 8) & 0xff;
printk(KERN_INFO "eps: Current multiplier = %d\n", current_multiplier);
pr_info("eps: Current multiplier = %d\n", current_multiplier);

/* Print limits */
max_voltage = hi & 0xff;
printk(KERN_INFO "eps: Highest voltage = %dmV\n",
max_voltage * 16 + 700);
pr_info("eps: Highest voltage = %dmV\n", max_voltage * 16 + 700);
max_multiplier = (hi >> 8) & 0xff;
printk(KERN_INFO "eps: Highest multiplier = %d\n", max_multiplier);
pr_info("eps: Highest multiplier = %d\n", max_multiplier);
min_voltage = (hi >> 16) & 0xff;
printk(KERN_INFO "eps: Lowest voltage = %dmV\n",
min_voltage * 16 + 700);
pr_info("eps: Lowest voltage = %dmV\n", min_voltage * 16 + 700);
min_multiplier = (hi >> 24) & 0xff;
printk(KERN_INFO "eps: Lowest multiplier = %d\n", min_multiplier);
pr_info("eps: Lowest multiplier = %d\n", min_multiplier);

/* Sanity checks */
if (current_multiplier == 0 || max_multiplier == 0
Expand All @@ -276,17 +271,13 @@ static int eps_cpu_init(struct cpufreq_policy *policy)

/* Check for systems using underclocked CPU */
if (!freq_failsafe_off && max_multiplier != current_multiplier) {
printk(KERN_INFO "eps: Your processor is running at different "
"frequency then its maximum. Aborting.\n");
printk(KERN_INFO "eps: You can use freq_failsafe_off option "
"to disable this check.\n");
pr_info("eps: Your processor is running at different frequency then its maximum. Aborting.\n");
pr_info("eps: You can use freq_failsafe_off option to disable this check.\n");
return -EINVAL;
}
if (!voltage_failsafe_off && max_voltage != current_voltage) {
printk(KERN_INFO "eps: Your processor is running at different "
"voltage then its maximum. Aborting.\n");
printk(KERN_INFO "eps: You can use voltage_failsafe_off "
"option to disable this check.\n");
pr_info("eps: Your processor is running at different voltage then its maximum. Aborting.\n");
pr_info("eps: You can use voltage_failsafe_off option to disable this check.\n");
return -EINVAL;
}

Expand All @@ -297,13 +288,13 @@ static int eps_cpu_init(struct cpufreq_policy *policy)
/* Check for ACPI processor speed limit */
if (!ignore_acpi_limit && !eps_acpi_init()) {
if (!acpi_processor_get_bios_limit(policy->cpu, &limit)) {
printk(KERN_INFO "eps: ACPI limit %u.%uGHz\n",
pr_info("eps: ACPI limit %u.%uGHz\n",
limit/1000000,
(limit%1000000)/10000);
eps_acpi_exit(policy);
/* Check if max_multiplier is in BIOS limits */
if (limit && max_multiplier * fsb > limit) {
printk(KERN_INFO "eps: Aborting.\n");
pr_info("eps: Aborting\n");
return -EINVAL;
}
}
Expand All @@ -319,8 +310,7 @@ static int eps_cpu_init(struct cpufreq_policy *policy)
v = (set_max_voltage - 700) / 16;
/* Check if voltage is within limits */
if (v >= min_voltage && v <= max_voltage) {
printk(KERN_INFO "eps: Setting %dmV as maximum.\n",
v * 16 + 700);
pr_info("eps: Setting %dmV as maximum\n", v * 16 + 700);
max_voltage = v;
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/cpufreq/elanfreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
static int __init elanfreq_setup(char *str)
{
max_freq = simple_strtoul(str, &str, 0);
printk(KERN_WARNING "You're using the deprecated elanfreq command line option. Use elanfreq.max_freq instead, please!\n");
pr_warn("You're using the deprecated elanfreq command line option. Use elanfreq.max_freq instead, please!\n");
return 1;
}
__setup("elanfreq=", elanfreq_setup);
Expand Down
9 changes: 4 additions & 5 deletions drivers/cpufreq/ia64-acpi-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ processor_get_freq (

if (ret) {
set_cpus_allowed_ptr(current, &saved_mask);
printk(KERN_WARNING "get performance failed with error %d\n",
ret);
pr_warn("get performance failed with error %d\n", ret);
ret = 0;
goto migrate_end;
}
Expand Down Expand Up @@ -177,7 +176,7 @@ processor_set_freq (

ret = processor_set_pstate(value);
if (ret) {
printk(KERN_WARNING "Transition failed with error %d\n", ret);
pr_warn("Transition failed with error %d\n", ret);
retval = -ENODEV;
goto migrate_end;
}
Expand Down Expand Up @@ -291,8 +290,8 @@ acpi_cpufreq_cpu_init (
/* notify BIOS that we exist */
acpi_processor_notify_smm(THIS_MODULE);

printk(KERN_INFO "acpi-cpufreq: CPU%u - ACPI performance management "
"activated.\n", cpu);
pr_info("acpi-cpufreq: CPU%u - ACPI performance management activated\n",
cpu);

for (i = 0; i < data->acpi_data.state_count; i++)
pr_debug(" %cP%d: %d MHz, %d mW, %d uS, %d uS, 0x%x 0x%x\n",
Expand Down
Loading

0 comments on commit b49c22a

Please sign in to comment.