From: Alexey Dobriyan <adobriyan@gmail.com>
To: corbet@lwn.net, skhan@linuxfoundation.org
Cc: adobriyan@gmail.com, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] CodingStyle: clarify variable naming rules
Date: Wed, 15 Jul 2026 18:42:20 +0300 [thread overview]
Message-ID: <20260715154220.234028-1-adobriyan@gmail.com> (raw)
* 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
reply other threads:[~2026-07-15 15:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260715154220.234028-1-adobriyan@gmail.com \
--to=adobriyan@gmail.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox