Skip to content

RFC Guiding Use of ssleep over msleep for Whole-Second Delays

Li Chen lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest1 patch 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1checkpatch: Add warning for msleep with durations suitable for ssleepscripts/checkpatch.pl+10 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/1] Guiding Use of ssleep over msleep for Whole-Second Delays

This change particularly targets replacing msleep() with ssleep() for delays that are clear multiples of 1000ms, enhancing code semantics and readability.

I'm contemplating a kernel-wide update to conform to this practice,
pending community feedback. While a sed script
(like '/\bmsleep\s*\(\s*([0-9]+000)\s*\);/{s/\bmsleep\s*\(\s*([0-9]+)000\s*\);/ssleep(\1);/g}') could automate this, I'm cautious of potential implications and seek
your thoughts on both the patch and the idea of a broad codebase update.

Li Chen (1):
checkpatch: Add warning for msleep with durations suitable for ssleep

 scripts/checkpatch.pl | 10 ++++++++++
 1 file changed, 10 insertions(+)
Signature · 1 line
2.44.0