Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp878191pxf; Wed, 7 Apr 2021 13:58:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPgNxUCtr+1qK+1lfIk/Lfti4FDRd80Q8lHspADsk3iI9AEcqzFw3ybIA2W0BiloW0bvcf X-Received: by 2002:a17:906:2da9:: with SMTP id g9mr5864993eji.100.1617829123668; Wed, 07 Apr 2021 13:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617829123; cv=none; d=google.com; s=arc-20160816; b=B3QX+wbNt2314bEnSE+KFMrRX8RqcRtxAbUgWI279SrU86SxX7TlHaAUUDIbRYCBcY 1e257bnnjZw9LE+eFq2r9FxS55K/Dgcr00o8kEimAI1pKzBVoIIjPGRf64crjNKgEJns OomaC+ViQhOjcXejoWIlv8oQ0Kbqz7XLp3NpvQ9HAWfjKmVmRgQq3j3Z6AKIfZIV5KNE z/0PQFrBsVljuYzFxPEnfkgnYXkEa9skX1PTB7DPx+iggEofET6OqjkA31w0QMCKpTki NV45XfOtO2rxyltCXAItvGP0Kpe1SqwUnHjKpw1DvK7hNdQ2uEFdJiUoKWoE00LBOlyt 2pGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Jd+JRtN+AlDyBMYfH+qI503Zhs8Hjmyv1FOUJ90JqHY=; b=o3rWiLMp+NXcOd85ZHsVzdOsmYAg7+gUlaXi/lRLWucYlCh7KPYgWtU1uWTNi2racv k0jvOs7lVPPPsucB8TsANur7cCVGFInJrgyCVzj7r7N54W4Om4P05WpRcr1CLDt2lplN rqzEYBQRcaLkoCeuFz6tXPo3ko2uK2/swOCWFgx9rr4/5Vykk0KIP/lDz3IFFa8P5OET wog87clkQFiKu0NPJVsgILkZXmHOf9sgVLhXJsTn6oOwd/9blDgnEFE0y/q1FY/lWwD7 6e8Jj3LH6VEZTyE1etvOmaygPMndDsYx46Ln0mmlveTdMQDodD991f/mMdMdayFev5BB /SPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w9si23017160edi.363.2021.04.07.13.58.20; Wed, 07 Apr 2021 13:58:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352121AbhDGMTr (ORCPT + 99 others); Wed, 7 Apr 2021 08:19:47 -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: linux-kernel@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