intel_idle: Use more common logging style
Remove #define PREFIX and add #define pr_fmt to use more common logging. Miscellanea: o Add missing newline to format o Convert a single printk without KERN_<LEVEL> to pr_info Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Jacob Pan <jacob.jun.pan@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
5209654a46
commit
654d08a42a
|
@ -51,6 +51,8 @@
|
||||||
/* un-comment DEBUG to enable pr_debug() statements */
|
/* un-comment DEBUG to enable pr_debug() statements */
|
||||||
#define DEBUG
|
#define DEBUG
|
||||||
|
|
||||||
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/cpuidle.h>
|
#include <linux/cpuidle.h>
|
||||||
#include <linux/tick.h>
|
#include <linux/tick.h>
|
||||||
|
@ -65,7 +67,6 @@
|
||||||
#include <asm/msr.h>
|
#include <asm/msr.h>
|
||||||
|
|
||||||
#define INTEL_IDLE_VERSION "0.4.1"
|
#define INTEL_IDLE_VERSION "0.4.1"
|
||||||
#define PREFIX "intel_idle: "
|
|
||||||
|
|
||||||
static struct cpuidle_driver intel_idle_driver = {
|
static struct cpuidle_driver intel_idle_driver = {
|
||||||
.name = "intel_idle",
|
.name = "intel_idle",
|
||||||
|
@ -1111,7 +1112,7 @@ static int __init intel_idle_probe(void)
|
||||||
const struct x86_cpu_id *id;
|
const struct x86_cpu_id *id;
|
||||||
|
|
||||||
if (max_cstate == 0) {
|
if (max_cstate == 0) {
|
||||||
pr_debug(PREFIX "disabled\n");
|
pr_debug("disabled\n");
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1119,8 +1120,8 @@ static int __init intel_idle_probe(void)
|
||||||
if (!id) {
|
if (!id) {
|
||||||
if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
|
if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
|
||||||
boot_cpu_data.x86 == 6)
|
boot_cpu_data.x86 == 6)
|
||||||
pr_debug(PREFIX "does not run on family %d model %d\n",
|
pr_debug("does not run on family %d model %d\n",
|
||||||
boot_cpu_data.x86, boot_cpu_data.x86_model);
|
boot_cpu_data.x86, boot_cpu_data.x86_model);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1134,13 +1135,13 @@ static int __init intel_idle_probe(void)
|
||||||
!mwait_substates)
|
!mwait_substates)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
pr_debug(PREFIX "MWAIT substates: 0x%x\n", mwait_substates);
|
pr_debug("MWAIT substates: 0x%x\n", mwait_substates);
|
||||||
|
|
||||||
icpu = (const struct idle_cpu *)id->driver_data;
|
icpu = (const struct idle_cpu *)id->driver_data;
|
||||||
cpuidle_state_table = icpu->state_table;
|
cpuidle_state_table = icpu->state_table;
|
||||||
|
|
||||||
pr_debug(PREFIX "v" INTEL_IDLE_VERSION
|
pr_debug("v" INTEL_IDLE_VERSION " model 0x%X\n",
|
||||||
" model 0x%X\n", boot_cpu_data.x86_model);
|
boot_cpu_data.x86_model);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1340,8 +1341,7 @@ static void __init intel_idle_cpuidle_driver_init(void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (cstate + 1 > max_cstate) {
|
if (cstate + 1 > max_cstate) {
|
||||||
printk(PREFIX "max_cstate %d reached\n",
|
pr_info("max_cstate %d reached\n", max_cstate);
|
||||||
max_cstate);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1358,8 +1358,8 @@ static void __init intel_idle_cpuidle_driver_init(void)
|
||||||
|
|
||||||
/* if state marked as disabled, skip it */
|
/* if state marked as disabled, skip it */
|
||||||
if (cpuidle_state_table[cstate].disabled != 0) {
|
if (cpuidle_state_table[cstate].disabled != 0) {
|
||||||
pr_debug(PREFIX "state %s is disabled",
|
pr_debug("state %s is disabled\n",
|
||||||
cpuidle_state_table[cstate].name);
|
cpuidle_state_table[cstate].name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1395,7 +1395,7 @@ static int intel_idle_cpu_init(unsigned int cpu)
|
||||||
dev->cpu = cpu;
|
dev->cpu = cpu;
|
||||||
|
|
||||||
if (cpuidle_register_device(dev)) {
|
if (cpuidle_register_device(dev)) {
|
||||||
pr_debug(PREFIX "cpuidle_register_device %d failed!\n", cpu);
|
pr_debug("cpuidle_register_device %d failed!\n", cpu);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1447,8 +1447,8 @@ static int __init intel_idle_init(void)
|
||||||
retval = cpuidle_register_driver(&intel_idle_driver);
|
retval = cpuidle_register_driver(&intel_idle_driver);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
struct cpuidle_driver *drv = cpuidle_get_driver();
|
struct cpuidle_driver *drv = cpuidle_get_driver();
|
||||||
printk(KERN_DEBUG PREFIX "intel_idle yielding to %s",
|
printk(KERN_DEBUG pr_fmt("intel_idle yielding to %s\n"),
|
||||||
drv ? drv->name : "none");
|
drv ? drv->name : "none");
|
||||||
goto init_driver_fail;
|
goto init_driver_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1460,8 +1460,8 @@ static int __init intel_idle_init(void)
|
||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
goto hp_setup_fail;
|
goto hp_setup_fail;
|
||||||
|
|
||||||
pr_debug(PREFIX "lapic_timer_reliable_states 0x%x\n",
|
pr_debug("lapic_timer_reliable_states 0x%x\n",
|
||||||
lapic_timer_reliable_states);
|
lapic_timer_reliable_states);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue