Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753511AbcCIL0D (ORCPT ); Wed, 9 Mar 2016 06:26:03 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:33817 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752246AbcCILZz (ORCPT ); Wed, 9 Mar 2016 06:25:55 -0500 Date: Wed, 9 Mar 2016 12:25:52 +0100 From: Jiri Pirko To: oulijun Cc: "Wei Hu(Xavier)" , dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com, davem@davemloft.net, jeffrey.t.kirsher@intel.com, jiri@mellanox.com, ogerlitz@mellanox.com, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, gongyangming@huawei.com, xiaokun@huawei.com, tangchaofei@huawei.com, haifeng.wei@huawei.com, yisen.zhuang@huawei.com, yankejian@huawei.com, lisheng011@huawei.com, charles.chenxin@huawei.com, linuxarm@huawei.com Subject: Re: [PATCH 3/4] infiniband: hns: add Hisilicon RoCE support(driver code) Message-ID: <20160309112552.GA2300@nanopsycho.orion> References: <1457080877-13456-1-git-send-email-xavier.huwei@huawei.com> <1457080877-13456-4-git-send-email-xavier.huwei@huawei.com> <20160304091628.GB2150@nanopsycho.orion> <56E0066E.1000106@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56E0066E.1000106@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1877 Lines: 65 Wed, Mar 09, 2016 at 12:18:06PM CET, oulijun@huawei.com wrote: >Hi Jiri Pirko, thanks for reviewing >On 2016/3/4 17:16, Jiri Pirko wrote: >> Fri, Mar 04, 2016 at 09:41:16AM CET, xavier.huwei@huawei.com wrote: >> >> >> >>> +int hns_roce_buf_alloc( >>> + struct hns_roce_dev *hr_dev, >>> + int size, int max_direct, >>> + struct hns_roce_buf *buf) >> >> >> >>> + >>> + pages = >>> + kmalloc(sizeof(*pages) * buf->nbufs, >>> + GFP_KERNEL); >> >> >> >>> + >>> + buf->direct.buf = vmap( >>> + pages, buf->nbufs, VM_MAP, >>> + PAGE_KERNEL); >> >> >> >>> + if ( >>> + event_type != HNS_ROCE_EVENT_TYPE_CQ_ID_INVALID && >>> + event_type != HNS_ROCE_EVENT_TYPE_CQ_ACCESS_ERROR && >>> + event_type != HNS_ROCE_EVENT_TYPE_CQ_OVERFLOW) { >>> + dev_err(&hr_dev->pdev->dev, >>> + "hns_roce_ib: Unexpected event type 0x%x on CQ %06x\n", >>> + event_type, hr_cq->cqn); >>> + return; >>> + } >> >> Although checkpatch does not complain, I find this semi-random adding of >> newlines quite odd. >> > Really, the question you mentioned exit in many location in currently patch. I done it >in order to make it complain checkpatch and linux norms. Now, I have checked and adjust it >properly combined to checkpatch > I will send a new patch in future. if not modified in some locations, it have to violate >checkpatch once modified and is unable to adjust it better. About these, have you best strategy? I'm not sure what violation you are talking about. I'm just simply suggesting to change: buf->direct.buf = vmap( pages, buf->nbufs, VM_MAP, PAGE_KERNEL); to: buf->direct.buf = vmap(pages, buf->nbufs, VM_MAP, PAGE_KERNEL); and to change: pages = kmalloc(sizeof(*pages) * buf->nbufs, GFP_KERNEL); to: pages = kmalloc(sizeof(*pages) * buf->nbufs, GFP_KERNEL);