[RFC PATCH 0/1] Guiding Use of ssleep over msleep for Whole-Second Delays
From: Li Chen
Date: Tue Mar 05 2024 - 10:56:59 EST
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(+)
--
2.44.0