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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F78CC433F5 for ; Tue, 22 Mar 2022 03:06:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235813AbiCVDHl (ORCPT ); Mon, 21 Mar 2022 23:07:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235801AbiCVDHl (ORCPT ); Mon, 21 Mar 2022 23:07:41 -0400 Received: from out30-45.freemail.mail.aliyun.com (out30-45.freemail.mail.aliyun.com [115.124.30.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 483872C7 for ; Mon, 21 Mar 2022 20:06:14 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R791e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=chengyou@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0V7tvfaV_1647918370; Received: from 30.43.105.158(mailfrom:chengyou@linux.alibaba.com fp:SMTPD_---0V7tvfaV_1647918370) by smtp.aliyun-inc.com(127.0.0.1); Tue, 22 Mar 2022 11:06:11 +0800 Message-ID: Date: Tue, 22 Mar 2022 11:06:10 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 From: Cheng Xu Subject: Re: [PATCH for-next v4 06/12] RDMA/erdma: Add event queue implementation To: Jason Gunthorpe Cc: Wenpeng Liang , dledford@redhat.com, leon@kernel.org, linux-rdma@vger.kernel.org, KaiShen@linux.alibaba.com, tonylu@linux.alibaba.com, BMT@zurich.ibm.com References: <20220314064739.81647-1-chengyou@linux.alibaba.com> <20220314064739.81647-7-chengyou@linux.alibaba.com> <57cd0171-5964-228f-b004-06cec1e4daae@huawei.com> <20220318181850.GG64706@ziepe.ca> <95ff44f2-e442-4e99-990d-2ef2fc9c1178@linux.alibaba.com> <20220321222314.GH64706@ziepe.ca> Content-Language: en-US In-Reply-To: <20220321222314.GH64706@ziepe.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On 3/22/22 6:23 AM, Jason Gunthorpe wrote: > On Sat, Mar 19, 2022 at 05:43:16PM +0800, Cheng Xu wrote: >> >> >> On 3/19/22 2:18 AM, Jason Gunthorpe wrote: >>> On Fri, Mar 18, 2022 at 07:43:21PM +0800, Wenpeng Liang wrote: >>> >>>>> +static int erdma_set_ceq_irq(struct erdma_dev *dev, u16 ceqn) >>>>> +{ >>>>> + struct erdma_eq_cb *eqc = &dev->ceqs[ceqn]; >>>>> + cpumask_t affinity_hint_mask; >>>>> + u32 cpu; >>>>> + int err; >>>>> + >>>>> + snprintf(eqc->irq_name, ERDMA_IRQNAME_SIZE, "erdma-ceq%u@pci:%s", >>>>> + ceqn, pci_name(dev->pdev)); >>>> >>>> Parameters in parentheses are not vertically aligned, a space is missing before "ceqn". >>> >>> Generally I will recommend such a large amount of code be run through >>> clang-format and the good things it changes be merged. Most of what it >>> suggests is good kernel style >>> >>> Jason >> >> Thanks, Jason. We already use clang-format since you recommended it last >> time. >> >> We review the changes made by clang-format case by case, and merge most >> of the changes. With a few cases, we handle them manually. >> >> For this case, clang-format put the ceqn at the first line, making it too >> long (80 chars), and then the two lines of snprintf look like not >> balance. So, I put the ceqn to the second line and broke the alignment >> by mistake. > > That sounds strange, clang-format never makes lines too long unless > strings are invovled... > Maybe I didn't explain this clearly. The clang-format's result is well and matches the rule, the result looks like this: line 1: snprintf(..., ..., ..., ceqn, // 80 chars line 2: pci_name(dev->pdev)); // 39 chars The line 1 (80 chars) looks much longer than line 2 (39 chars). So I put the 'ceqn' at line 2, then the length of the two lines are more close, and may looks better: line 1: snprintf(..., ..., ..., // 74 chars line 2: ceqn, pci_name(dev->pdev)); // 45 chars Thanks, Cheng Xu > Jason