From: Neel Bullywon <neelb2403@gmail.com>
To: apw@canonical.com, joe@perches.com
Cc: dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com,
andriy.shevchenko@intel.com, linux-kernel@vger.kernel.org,
Neel Bullywon <neelb2403@gmail.com>
Subject: [PATCH v2] checkpatch: mention fsleep() in MSLEEP and USLEEP_RANGE warnings
Date: Fri, 20 Feb 2026 18:05:55 -0500 [thread overview]
Message-ID: <20260220230555.56255-1-neelb2403@gmail.com> (raw)
Expand the MSLEEP warning to also reference fsleep() alongside
msleep(), and expand the USLEEP_RANGE check to reference fsleep()
alongside usleep_range() and udelay(). fsleep() autoselects the
best sleep mechanism based on duration, making it a useful
alternative for developers to consider.
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Neel Bullywon <neelb2403@gmail.com>
---
Changes in v2:
- Keep existing warning text and expand to mention fsleep() instead
of replacing the msleep() reference (Andy).
- Also update the USLEEP_RANGE check to mention fsleep() (Andy).
scripts/checkpatch.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index c0250244cf7a..03c070bfa0a4 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -6624,7 +6624,7 @@ sub process {
# ignore udelay's < 10, however
if (! ($delay < 10) ) {
CHK("USLEEP_RANGE",
- "usleep_range is preferred over udelay; see function description of usleep_range() and udelay().\n" . $herecurr);
+ "usleep_range is preferred over udelay; see function description of usleep_range(), udelay(), and fsleep().\n" . $herecurr);
}
if ($delay > 2000) {
WARN("LONG_UDELAY",
@@ -6636,7 +6636,7 @@ sub process {
if ($line =~ /\bmsleep\s*\((\d+)\);/) {
if ($1 < 20) {
WARN("MSLEEP",
- "msleep < 20ms can sleep for up to 20ms; see function description of msleep().\n" . $herecurr);
+ "msleep < 20ms can sleep for up to 20ms; see function description of msleep() and fsleep().\n" . $herecurr);
}
}
base-commit: e7aa57247700733e52a8e2e4dee6a52c2a76de02
--
2.44.0
next reply other threads:[~2026-02-20 23:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-20 23:05 Neel Bullywon [this message]
2026-02-22 11:11 ` Andy Shevchenko
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=20260220230555.56255-1-neelb2403@gmail.com \
--to=neelb2403@gmail.com \
--cc=andriy.shevchenko@intel.com \
--cc=apw@canonical.com \
--cc=dwaipayanray1@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
/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
all inboxes | Powered by JetHome®