* [PATCH 1/3] PM: console: fix minor style issues and improve readability
@ 2026-04-17 14:09 Mohit Joshi
2026-04-17 14:09 ` [PATCH 2/3] PM: hibernate: fix minor style inconsistencies Mohit Joshi
2026-04-17 14:09 ` [PATCH 3/3] PM: wakelock: fix spacing and improve readability Mohit Joshi
0 siblings, 2 replies; 3+ messages in thread
From: Mohit Joshi @ 2026-04-17 14:09 UTC (permalink / raw)
To: rafael; +Cc: linux-pm, Mohit Joshi
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/3] PM: hibernate: fix minor style inconsistencies
2026-04-17 14:09 [PATCH 1/3] PM: console: fix minor style issues and improve readability Mohit Joshi
@ 2026-04-17 14:09 ` Mohit Joshi
2026-04-17 14:09 ` [PATCH 3/3] PM: wakelock: fix spacing and improve readability Mohit Joshi
1 sibling, 0 replies; 3+ messages in thread
From: Mohit Joshi @ 2026-04-17 14:09 UTC (permalink / raw)
To: rafael; +Cc: linux-pm, Mohit Joshi
---
kernel/power/hibernate.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index af8d07bafe02..f077659790e0 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -837,8 +837,9 @@ int hibernate(void)
goto Thaw;
error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM);
+ /* Skip writing image if error or test mode */
if (error || freezer_test_done)
- goto Free_bitmaps;
+ goto Free_bitmaps;
if (in_suspend) {
unsigned int flags = 0;
@@ -848,7 +849,7 @@ int hibernate(void)
if (nocompress) {
flags |= SF_NOCOMPRESS_MODE;
} else {
- flags |= SF_CRC32_MODE;
+ flags |= SF_CRC32_MODE;
/*
* By default, LZO compression is enabled. Use SF_COMPRESSION_ALG_LZ4
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 3/3] PM: wakelock: fix spacing and improve readability
2026-04-17 14:09 [PATCH 1/3] PM: console: fix minor style issues and improve readability Mohit Joshi
2026-04-17 14:09 ` [PATCH 2/3] PM: hibernate: fix minor style inconsistencies Mohit Joshi
@ 2026-04-17 14:09 ` Mohit Joshi
1 sibling, 0 replies; 3+ messages in thread
From: Mohit Joshi @ 2026-04-17 14:09 UTC (permalink / raw)
To: rafael; +Cc: linux-pm, Mohit Joshi
---
kernel/power/wakelock.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/kernel/power/wakelock.c b/kernel/power/wakelock.c
index fd763da06a87..9f576809b5f5 100644
--- a/kernel/power/wakelock.c
+++ b/kernel/power/wakelock.c
@@ -214,13 +214,15 @@ int pm_wake_lock(const char *buf)
if (!capable(CAP_BLOCK_SUSPEND))
return -EPERM;
+ /* Extract wakelock name (until space or end) */
while (*str && !isspace(*str))
- str++;
+ str++;
len = str - buf;
if (!len)
return -EINVAL;
+ /* Check for optional timeout value */
if (*str && *str != '\n') {
/* Find out if there's a valid timeout string appended. */
ret = kstrtou64(skip_spaces(str), 10, &timeout_ns);
@@ -245,7 +247,6 @@ int pm_wake_lock(const char *buf)
}
wakelocks_lru_most_recent(wl);
-
out:
mutex_unlock(&wakelocks_lock);
return ret;
@@ -264,7 +265,7 @@ int pm_wake_unlock(const char *buf)
if (!len)
return -EINVAL;
- if (buf[len-1] == '\n')
+ if (buf[len - 1] == '\n')
len--;
if (!len)
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-17 14:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-17 14:09 [PATCH 1/3] PM: console: fix minor style issues and improve readability Mohit Joshi
2026-04-17 14:09 ` [PATCH 2/3] PM: hibernate: fix minor style inconsistencies Mohit Joshi
2026-04-17 14:09 ` [PATCH 3/3] PM: wakelock: fix spacing and improve readability Mohit Joshi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox