Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6ED5CC433EF for ; Sat, 2 Jul 2022 03:12:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231196AbiGBDMR (ORCPT ); Fri, 1 Jul 2022 23:12:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230258AbiGBDMP (ORCPT ); Fri, 1 Jul 2022 23:12:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0024037A37 for ; Fri, 1 Jul 2022 20:12:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8A89A61C4F for ; Sat, 2 Jul 2022 03:12:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF994C341CE; Sat, 2 Jul 2022 03:12:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656731533; bh=ijGVsT06kuU0X/TQHyfW7ArSmZQVHiqpQ+C+wY5SvHk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KqmVMzhizhMu7fp5Xmu/aVeE0ibqLe25HImx9P//8BcmYDz4JRDPFhBVtP9YBhGOC 0TO3yBYZwrYdmJZI+gVr6kVJ1oCFZ5ceuTdSANTAjax8++/ht7Qba219OiffsYzyDx OdqbNyAFCdwS920Fr/QL7s6Bj+x6v2vMYa4hZrR3+y+lgxzfE8HkWheXWAe0e0ByzN tQb7oGH11Yf3obNR8ejwtInxEV8rlp+o+baggtyysfrUQXlqSjYI7ZCsx354GhkQh1 n/aXf6Gva+2POUsu9stlgYeGSa0WS0URA7nPXSwP7nmxeLaGekATa7237zgbwMrE6m Xbwxjoc1zN7wA== From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, andrew@lunn.ch, Jakub Kicinski Subject: [PATCH net v2 2/3] docs: netdev: document reverse xmas tree Date: Fri, 1 Jul 2022 20:12:08 -0700 Message-Id: <20220702031209.790535-3-kuba@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220702031209.790535-1-kuba@kernel.org> References: <20220702031209.790535-1-kuba@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Similarly to the 15 patch rule the reverse xmas tree is not documented. Signed-off-by: Jakub Kicinski --- 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 79a10d05031e..8a9dae7a0524 100644 --- a/Documentation/process/maintainer-netdev.rst +++ b/Documentation/process/maintainer-netdev.rst @@ -197,6 +197,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