[PATCH] checkpatch: suggest fsleep() for short msleep() calls

From: Neel Bullywon

Date: Sun Feb 08 2026 - 10:59:48 EST


Update the MSLEEP warning to suggest fsleep() as a duration based
sleep API. fsleep() autoselects the best sleep mechanism (udelay,
usleep_range, or msleep) based on the requested duration, making
it the preferred replacement for short msleep() calls.

Suggested-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
Signed-off-by: Neel Bullywon <neelb2403@xxxxxxxxx>
---
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index c0250244cf7a..c27045f9f13d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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 fsleep().\n" . $herecurr);
}
}


base-commit: e7aa57247700733e52a8e2e4dee6a52c2a76de02
--
2.44.0