From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752274AbdHHQXu (ORCPT ); Tue, 8 Aug 2017 12:23:50 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2590 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752092AbdHHQXt (ORCPT ); Tue, 8 Aug 2017 12:23:49 -0400 Subject: Re: [PATCH V3 net-next 03/21] net-next/hinic: Initialize api cmd resources To: David Miller CC: , , , , , References: <18d3bfccc0eb9c7da53075c6fe2ba9aa583e0bff.1501752425.git.aviad.krawczyk@huawei.com> <20170803.153513.1478323340993171697.davem@davemloft.net> From: Aviad Krawczyk Message-ID: <912a2667-8b20-cbc2-4c32-7d34bfb6bb9b@huawei.com> Date: Tue, 8 Aug 2017 19:23:32 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170803.153513.1478323340993171697.davem@davemloft.net> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.206.50.78] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090201.5989E592.00AF,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 52ecaf7663a1c51553d5e2bed28bedb7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi David, Is it a new rule? We can fix it, but I can look over the Linux Kernel source and there are a lot of examples that have the same problem. I can see even code that inserted to 4.10 with the same problem. Thanks for your time and review, Aviad On 8/4/2017 1:35 AM, David Miller wrote: > From: Aviad Krawczyk > Date: Thu, 3 Aug 2017 17:54:09 +0800 > >> +static int alloc_cmd_buf(struct hinic_api_cmd_chain *chain, >> + struct hinic_api_cmd_cell *cell, int cell_idx) >> +{ >> + struct hinic_hwif *hwif = chain->hwif; >> + struct pci_dev *pdev = hwif->pdev; >> + struct hinic_api_cmd_cell_ctxt *cell_ctxt; >> + dma_addr_t cmd_paddr; >> + u8 *cmd_vaddr; >> + int err = 0; > > Order local variables from longest to shortest line. > >> +static int api_cmd_create_cell(struct hinic_api_cmd_chain *chain, >> + int cell_idx, >> + struct hinic_api_cmd_cell *pre_node, >> + struct hinic_api_cmd_cell **node_vaddr) >> +{ >> + struct hinic_hwif *hwif = chain->hwif; >> + struct pci_dev *pdev = hwif->pdev; >> + struct hinic_api_cmd_cell_ctxt *cell_ctxt; >> + struct hinic_api_cmd_cell *node; >> + dma_addr_t node_paddr; >> + int err; > > Likewise. >> +static void api_cmd_destroy_cell(struct hinic_api_cmd_chain *chain, >> + int cell_idx) >> +{ >> + struct hinic_hwif *hwif = chain->hwif; >> + struct pci_dev *pdev = hwif->pdev; >> + struct hinic_api_cmd_cell_ctxt *cell_ctxt; >> + struct hinic_api_cmd_cell *node; >> + dma_addr_t node_paddr; >> + size_t node_size; > > Likewise. > > etc. etc. etc. > > Please audit your entire submission for this problem. > > Thanks. > > . >