From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53CE4C433B4 for ; Wed, 7 Apr 2021 12:19:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2093761245 for ; Wed, 7 Apr 2021 12:19:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352126AbhDGMTs (ORCPT ); Wed, 7 Apr 2021 08:19:48 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:37992 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352110AbhDGMTp (ORCPT ); Wed, 7 Apr 2021 08:19:45 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lU79a-00FIwe-Go; Wed, 07 Apr 2021 14:19:26 +0200 Date: Wed, 7 Apr 2021 14:19:26 +0200 From: Andrew Lunn To: Dexuan Cui Cc: "davem@davemloft.net" , "kuba@kernel.org" , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , "wei.liu@kernel.org" , Wei Liu , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" Subject: Re: [PATCH net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA) Message-ID: References: <20210406232321.12104-1-decui@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > And, some variable defines can not follow the reverse christmas tree > style due to dependency, e.g. > static void hwc_init_event_handler(void *ctx, struct gdma_queue *q_self, > struct gdma_event *event) > { > struct hw_channel_context *hwc = ctx; > struct gdma_dev *gd = hwc->gdma_dev; > struct gdma_context *gc = gdma_dev_to_context(gd); > > I failed to find the reverse christmas tree rule in the Documentation/ > folder. I knew the rule and I thought it was documented there, > but it looks like it's not. So my understanding is that in general we > should follow the style, but there can be exceptions due to > dependencies or logical grouping. I expect DaveM will tell you to move gdma_dev_to_context(gd) into the body of the function. Or if you have this pattern a lot, add a macro gdma_ctx_to_context(). Reverse Christmas tree is not in the main Coding Style documentation, but it is expected for netdev. Andrew