Commit a2487564 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller
Browse files

docs: netdev: document reverse xmas tree



Similarly to the 15 patch rule the reverse xmas tree is not
documented.

Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 02514a06
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -197,6 +197,19 @@ it is requested that you make it look like this::
   * 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