* [PATCH 1/1] CodingStyle: clarify variable naming rules
@ 2026-07-15 15:42 Alexey Dobriyan
0 siblings, 0 replies; only message in thread
From: Alexey Dobriyan @ 2026-07-15 15:42 UTC (permalink / raw)
To: corbet, skhan; +Cc: adobriyan, linux-doc, linux-kernel
* sysctl stuff better have "sysctl" in its name to remind developers
to use READ_ONCE() and that their values can change at any time,
* variable holding physical time should append unit of time to the name,
to make life easier for developers and static checkers.
Jiffies aren't included because I'd be crucified for "_ji".
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
Documentation/process/coding-style.rst | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/process/coding-style.rst b/Documentation/process/coding-style.rst
index a8336582f60b..d97ed5be4eab 100644
--- a/Documentation/process/coding-style.rst
+++ b/Documentation/process/coding-style.rst
@@ -356,6 +356,11 @@ specification that mandates those terms. For new specifications
translate specification usage of the terminology to the kernel coding
standard where possible.
+Variable holding sysctl value should have ``sysctl`` in its name.
+
+Variable measuring time should be suffixed with the unit of time it is measured in:
+``_s`` for seconds, ``_ms`` for milliseconds, ``_us`` for microseconds, ``_ns`` for nanoseconds.
+
5) Typedefs
-----------
--
2.54.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-15 15:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-15 15:42 [PATCH 1/1] CodingStyle: clarify variable naming rules Alexey Dobriyan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox