Skip to contentSkip to conversation

drivers: cpuidle: This patch fix the following checkpatch warning.

PATCH In review Mohan Kumar 2 participants 2 messages Apr 17, 2019 – Apr 18, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: cpuidle: This patch fix the following checkpatch warning.

Use pr_debug instead of printk

WARNING: Prefer [subsystem eg: netdev]_dbg([subsystem]dev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ...

---
 drivers/cpuidle/cpuidle-powernv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cpuidle/cpuidle-powernv.c +2 -2
index 84b1ebe..7cf9835 100644
@@ -401,7 +401,7 @@ static int __init powernv_processor_idle_init(void)
 	powernv_cpuidle_driver_init();
 	retval = cpuidle_register(&powernv_idle_driver, NULL);
 	if (retval) {
-		printk(KERN_DEBUG "Registration of powernv driver failed.\n");
+		pr_debug("Registration of powernv driver failed.\n");
 		return retval;
 	}
 
@@ -413,7 +413,7 @@ static int __init powernv_processor_idle_init(void)
 					   "cpuidle/powernv:dead", NULL,
 					   powernv_cpuidle_cpu_dead);
 	WARN_ON(retval < 0);
-	printk(KERN_DEBUG "powernv_idle_driver registered\n");
+	pr_debug("powernv_idle_driver registered\n");
 	return 0;
 }
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 25 lines · CEST Mohan Kumar

Use pr_debug instead of printk

WARNING: Prefer [subsystem eg: netdev]_dbg([subsystem]dev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ...

---
 drivers/cpuidle/cpuidle-powernv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cpuidle/cpuidle-powernv.c +1 -1
index 84b1ebe..7cf9835 100644
@@ -401,7 +401,7 @@ static int __init powernv_processor_idle_init(void)
 	powernv_cpuidle_driver_init();
 	retval = cpuidle_register(&powernv_idle_driver, NULL);
 	if (retval) {
-		printk(KERN_DEBUG "Registration of powernv driver failed.\n");
+		pr_debug("Registration of powernv driver failed.\n");
 		return retval;
 	}
 

drivers/cpuidle/cpuidle-powernv.c static int __init powernv_processor_idle_init(void) · line 419

Quoted 8 lines
drivers/cpuidle/cpuidle-powernv.c +1 -1
@@ -413,7 +413,7 @@ static int __init powernv_processor_idle_init(void)
 					   "cpuidle/powernv:dead", NULL,
 					   powernv_cpuidle_cpu_dead);
 	WARN_ON(retval < 0);
-	printk(KERN_DEBUG "powernv_idle_driver registered\n");
+	pr_debug("powernv_idle_driver registered\n");
 	return 0;
 }
 

Recently, you've sent two different patches against two different drivers with the same subject.

IMO it is fair enough to call that "confusing".

Moreover, pr_debug() is not a direct replacement for printk(KERN_DEBUG ) as the latter does not require dynamic debug to be enabled and I'm not really sure if you are aware of that difference.