From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
corbet@lwn.net, linux-doc@vger.kernel.org,
Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net 2/3] docs: netdev: document reverse xmas tree
Date: Thu, 30 Jun 2022 10:46:06 -0700 [thread overview]
Message-ID: <20220630174607.629408-3-kuba@kernel.org> (raw)
In-Reply-To: <20220630174607.629408-1-kuba@kernel.org>
Similarly to the 15 patch rule the reverse xmas tree is not
documented.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
Documentation/process/maintainer-netdev.rst | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/Documentation/process/maintainer-netdev.rst b/Documentation/process/maintainer-netdev.rst
index 862b6508fc22..7fb5100d195d 100644
--- a/Documentation/process/maintainer-netdev.rst
+++ b/Documentation/process/maintainer-netdev.rst
@@ -191,6 +191,19 @@ Is the comment style convention different for the networking content?
* another line of text
*/
+What is "reverse xmas tree"?
+----------------------------
+
+Netdev has a convention for ordering local variables in functions.
+Order the variable declaration lines longest to shortest, e.g.::
+
+ struct scatterlist *sg;
+ struct sk_buff *skb;
+ int err, i;
+
+If there are dependencies between the variables preventing the ordering
+move the initialization out of line.
+
I am working in existing code which uses non-standard formatting. Which formatting should I use?
------------------------------------------------------------------------------------------------
Make your code follow the most recent guidelines, so that eventually all code
--
2.36.1
next prev parent reply other threads:[~2022-06-30 17:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-30 17:46 [PATCH net 0/3] docs: netdev: document more of our rules Jakub Kicinski
2022-06-30 17:46 ` [PATCH net 1/3] docs: netdev: document that patch series length limit Jakub Kicinski
2022-07-01 7:48 ` Andrew Lunn
2022-07-01 16:16 ` Jakub Kicinski
2022-06-30 17:46 ` Jakub Kicinski [this message]
2022-06-30 17:46 ` [PATCH net 3/3] docs: netdev: add a cheat sheet for the rules Jakub Kicinski
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=20220630174607.629408-3-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=linux-doc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.