Skip to content

Commit bebcdae

Browse files
committed
PM / suspend: Use mem_sleep_labels[] strings in messages
Some messages in suspend.c currently print state names from pm_states[], but that may be confusing if the mem_sleep sysfs attribute is changed to anything different from "mem", because in those cases the messages will say either "freeze" or "standby" after writing "mem" to /sys/power/state. To avoid the confusion, use mem_sleep_labels[] strings in those messages instead. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
1 parent e516a1d commit bebcdae

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎kernel/power/suspend.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ static int enter_state(suspend_state_t state)
560560
trace_suspend_resume(TPS("sync_filesystems"), 0, false);
561561
#endif
562562

563-
pm_pr_dbg("Preparing system for sleep (%s)\n", pm_states[state]);
563+
pm_pr_dbg("Preparing system for sleep (%s)\n", mem_sleep_labels[state]);
564564
pm_suspend_clear_flags();
565565
error = suspend_prepare(state);
566566
if (error)
@@ -570,7 +570,7 @@ static int enter_state(suspend_state_t state)
570570
goto Finish;
571571

572572
trace_suspend_resume(TPS("suspend_enter"), state, false);
573-
pm_pr_dbg("Suspending system (%s)\n", pm_states[state]);
573+
pm_pr_dbg("Suspending system (%s)\n", mem_sleep_labels[state]);
574574
pm_restrict_gfp_mask();
575575
error = suspend_devices_and_enter(state);
576576
pm_restore_gfp_mask();
@@ -597,7 +597,7 @@ int pm_suspend(suspend_state_t state)
597597
if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX)
598598
return -EINVAL;
599599

600-
pr_info("PM: suspend entry (%s)\n", pm_states[state]);
600+
pr_info("PM: suspend entry (%s)\n", mem_sleep_labels[state]);
601601
error = enter_state(state);
602602
if (error) {
603603
suspend_stats.fail++;

0 commit comments

Comments
 (0)