From: Mohit Joshi <joshionmohit@gmail.com>
To: rafael@kernel.org
Cc: linux-pm@vger.kernel.org, Mohit Joshi <joshionmohit@gmail.com>
Subject: [PATCH 3/3] PM: wakelock: fix spacing and improve readability
Date: Fri, 17 Apr 2026 19:39:56 +0530 [thread overview]
Message-ID: <20260417140956.55232-3-joshionmohit@gmail.com> (raw)
In-Reply-To: <20260417140956.55232-1-joshionmohit@gmail.com>
---
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
prev parent reply other threads:[~2026-04-17 14:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260417140956.55232-3-joshionmohit@gmail.com \
--to=joshionmohit@gmail.com \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox