Skip to content

Commit a248756

Browse files
kuba-moodavem330
authored andcommitted
docs: netdev: document reverse xmas tree
Similarly to the 15 patch rule the reverse xmas tree is not documented. Signed-off-by: Jakub Kicinski <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 02514a0 commit a248756

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Documentation/process/maintainer-netdev.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,19 @@ it is requested that you make it look like this::
197197
* another line of text
198198
*/
199199

200+
What is "reverse xmas tree"?
201+
----------------------------
202+
203+
Netdev has a convention for ordering local variables in functions.
204+
Order the variable declaration lines longest to shortest, e.g.::
205+
206+
struct scatterlist *sg;
207+
struct sk_buff *skb;
208+
int err, i;
209+
210+
If there are dependencies between the variables preventing the ordering
211+
move the initialization out of line.
212+
200213
I am working in existing code which uses non-standard formatting. Which formatting should I use?
201214
------------------------------------------------------------------------------------------------
202215
Make your code follow the most recent guidelines, so that eventually all code

0 commit comments

Comments
 (0)