CodingStyle: clarify variable naming rules
Subsystems (2)
PATCH 1/1 CodingStyle: clarify variable naming rules
* 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 <[email protected]>
--- Documentation/process/coding-style.rst | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/process/coding-style.rst +5 -0
@@ -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 -----------
Signature · 1 line
2.54.0