Skip to contentSkip to conversation

PM / suspend: replacing printk

PATCH Superseded Saurabh Sengar 4 participants 4 messages Oct 27, 2015 1 message not in the archive

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 PM / suspend: replacing printk

replacing prink(s) with appropriate pr_info and pr_err

---
 kernel/power/suspend.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/power/suspend.c +3 -3
index 7e4cda4..2d8856b 100644
@@ -245,7 +245,7 @@ static int suspend_test(int level)
 {
 #ifdef CONFIG_PM_DEBUG
 	if (pm_test_level == level) {
-		printk(KERN_INFO "suspend debug: Waiting for %d second(s).\n",
+		pr_info("suspend debug: Waiting for %d second(s).",
 				pm_test_delay);
 		mdelay(pm_test_delay * 1000);
 		return 1;
@@ -317,7 +317,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
 
 	error = dpm_suspend_late(PMSG_SUSPEND);
 	if (error) {
-		printk(KERN_ERR "PM: late suspend of devices failed\n");
+		pr_err("PM: late suspend of devices failed");
 		goto Platform_finish;
 	}
 	error = platform_suspend_prepare_late(state);
@@ -326,7 +326,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
 
 	error = dpm_suspend_noirq(PMSG_SUSPEND);
 	if (error) {
-		printk(KERN_ERR "PM: noirq suspend of devices failed\n");
+		pr_err("PM: noirq suspend of devices failed");
 		goto Platform_early_resume;
 	}
 	error = platform_suspend_prepare_noirq(state);
Signature · 1 line
1.9.1
#1 lore raw
Quoted 6 lines · Saurabh Sengar

replacing prink(s) with appropriate pr_info and pr_err

---
 kernel/power/suspend.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

In which way does this patch improve the existing code? You describe what it does but not which problem it solves and why this patch is necessary.

Signature · 2 lines
Thanks,
//richard

A message that is not in the archive (sent off-list or not yet received): CAA8avJ9-VNKt=otfhjPtDQq1Tq38=P=Bx=3v7dH58ymKT5Mr6w@mail.gmail.com

#3 lore raw

Am 27.10.2015 um 20:32 schrieb Saurabh Sengar:

Quoted 1 line

it fixes the checkpatch.pl <http://checkpatch.pl> warnings

Don't get me wrong, but checkpatch.pl is only a script which makes suggestions. Especially as these are only warnings and not errors.

IMHO the code is perfectly fine as is.

Thanks,
//richard

Quoted 18 lines · On Oct 28, 2015 12:56 AM, "Richard Weinberger" <[email protected]…
Quoted 16 lines · On Tue, Oct 27, 2015 at 8:21 PM, Saurabh Sengar <[email protected]…
Quoted 6 lines

replacing prink(s) with appropriate pr_info and pr_err

Signed-off-by Saurabh Sengar <[email protected] <mailto:[email protected]>>
---
 kernel/power/suspend.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

In which way does this patch improve the existing code? You describe what it does but not which problem it solves and why this patch is necessary.

--
Thanks,
//richard

#4 lore raw
In reply to Saurabh Sengar
Quoted 1 line · Saurabh Sengar

replacing prink(s) with appropriate pr_info and pr_err

Removing the terminating newlines is likely incorrect.

kernel/power/suspend.c

Quoted 1 line
kernel/power/suspend.c +0 -0

[]

Quoted 27 lines
kernel/power/suspend.c +3 -3
@@ -245,7 +245,7 @@ static int suspend_test(int level)
 {
 #ifdef CONFIG_PM_DEBUG
 	if (pm_test_level == level) {
-		printk(KERN_INFO "suspend debug: Waiting for %d second(s).\n",
+		pr_info("suspend debug: Waiting for %d second(s).",
 				pm_test_delay);
 		mdelay(pm_test_delay * 1000);
 		return 1;
@@ -317,7 +317,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
 
 	error = dpm_suspend_late(PMSG_SUSPEND);
 	if (error) {
-		printk(KERN_ERR "PM: late suspend of devices failed\n");
+		pr_err("PM: late suspend of devices failed");
 		goto Platform_finish;
 	}
 	error = platform_suspend_prepare_late(state);
@@ -326,7 +326,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
 
 	error = dpm_suspend_noirq(PMSG_SUSPEND);
 	if (error) {
-		printk(KERN_ERR "PM: noirq suspend of devices failed\n");
+		pr_err("PM: noirq suspend of devices failed");
 		goto Platform_early_resume;
 	}
 	error = platform_suspend_prepare_noirq(state);