[PATCH 1/3] PM: console: fix minor style issues and improve readability

Mohit Joshi
2026-04-17T14:10:07Z

---
kernel/power/console.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/power/console.c b/kernel/power/console.c
index 33ace63b1088..57377046933b 100644
--- a/kernel/power/console.c
+++ b/kernel/power/console.c
@@ -16,6 +16,7 @@
#define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1)

static int orig_fgconsole, orig_kmsg;
+/* Tracking whether we switched VT during suspend or not */
static bool vt_switch_done;

static DEFINE_MUTEX(vt_switch_mutex);
@@ -62,7 +63,7 @@ int pm_vt_switch_required(struct device *dev, bool required)
if (!entry) {
ret = -ENOMEM;
goto out;
- }
+ }

entry->required = required;
entry->dev = dev;
@@ -144,11 +145,11 @@ void pm_prepare_console(void)
vt_switch_done = true;

orig_kmsg = vt_kmsg_redirect(SUSPEND_CONSOLE);
- return;
}

void pm_restore_console(void)
{
+ /*No switch is needed & none was done*/
if (!pm_vt_switch() && !vt_switch_done)
return;

--
2.43.0