The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] checkpatch: suggest fsleep() for short msleep() calls
@ 2026-02-08 15:59 Neel Bullywon
  2026-02-08 16:36 ` Joe Perches
  2026-02-09  8:32 ` Andy Shevchenko
  0 siblings, 2 replies; 6+ messages in thread
From: Neel Bullywon @ 2026-02-08 15:59 UTC (permalink / raw)
  To: apw, joe
  Cc: dwaipayanray1, lukas.bulwahn, andriy.shevchenko, linux-kernel,
	Neel Bullywon

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@intel.com>
Signed-off-by: Neel Bullywon <neelb2403@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-02-09  8:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-08 15:59 [PATCH] checkpatch: suggest fsleep() for short msleep() calls Neel Bullywon
2026-02-08 16:36 ` Joe Perches
2026-02-08 18:41   ` Neel Bullywon
2026-02-08 18:44   ` Joe Perches
2026-02-09  8:32 ` Andy Shevchenko
2026-02-09  8:34   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox