Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 654d08a4 authored by Joe Perches's avatar Joe Perches Committed by Rafael J. Wysocki
Browse files

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: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarJacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 5209654a
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -51,6 +51,8 @@
/* un-comment DEBUG to enable pr_debug() statements */
#define DEBUG

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
#include <linux/cpuidle.h>
#include <linux/tick.h>
@@ -65,7 +67,6 @@
#include <asm/msr.h>

#define INTEL_IDLE_VERSION "0.4.1"
#define PREFIX "intel_idle: "

static struct cpuidle_driver intel_idle_driver = {
	.name = "intel_idle",
@@ -1111,7 +1112,7 @@ static int __init intel_idle_probe(void)
	const struct x86_cpu_id *id;

	if (max_cstate == 0) {
		pr_debug(PREFIX "disabled\n");
		pr_debug("disabled\n");
		return -EPERM;
	}

@@ -1119,7 +1120,7 @@ static int __init intel_idle_probe(void)
	if (!id) {
		if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
		    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);
		return -ENODEV;
	}
@@ -1134,13 +1135,13 @@ static int __init intel_idle_probe(void)
	    !mwait_substates)
			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;
	cpuidle_state_table = icpu->state_table;

	pr_debug(PREFIX "v" INTEL_IDLE_VERSION
		" model 0x%X\n", boot_cpu_data.x86_model);
	pr_debug("v" INTEL_IDLE_VERSION " model 0x%X\n",
		 boot_cpu_data.x86_model);

	return 0;
}
@@ -1340,8 +1341,7 @@ static void __init intel_idle_cpuidle_driver_init(void)
			break;

		if (cstate + 1 > max_cstate) {
			printk(PREFIX "max_cstate %d reached\n",
				max_cstate);
			pr_info("max_cstate %d reached\n", max_cstate);
			break;
		}

@@ -1358,7 +1358,7 @@ static void __init intel_idle_cpuidle_driver_init(void)

		/* if state marked as disabled, skip it */
		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);
			continue;
		}
@@ -1395,7 +1395,7 @@ static int intel_idle_cpu_init(unsigned int cpu)
	dev->cpu = cpu;

	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;
	}

@@ -1447,7 +1447,7 @@ static int __init intel_idle_init(void)
	retval = cpuidle_register_driver(&intel_idle_driver);
	if (retval) {
		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");
		goto init_driver_fail;
	}
@@ -1460,7 +1460,7 @@ static int __init intel_idle_init(void)
	if (retval < 0)
		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);

	return 0;