From patchwork Wed Feb 8 19:53:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 9563313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9418D60236 for ; Wed, 8 Feb 2017 19:59:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A2DC28446 for ; Wed, 8 Feb 2017 19:59:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EA992847F; Wed, 8 Feb 2017 19:59:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1357428446 for ; Wed, 8 Feb 2017 19:59:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751459AbdBHT6z (ORCPT ); Wed, 8 Feb 2017 14:58:55 -0500 Received: from smtprelay0177.hostedemail.com ([216.40.44.177]:50764 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751111AbdBHT6W (ORCPT ); Wed, 8 Feb 2017 14:58:22 -0500 Received: from smtprelay.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by smtpgrave03.hostedemail.com (Postfix) with ESMTP id B9CC5290886; Wed, 8 Feb 2017 19:58:20 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay08.hostedemail.com (Postfix) with ESMTP id 70BA829DD77; Wed, 8 Feb 2017 19:53:37 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: hands18_58f378675c114 X-Filterd-Recvd-Size: 3993 Received: from XPS-9350 (unknown [47.151.132.55]) (Authenticated sender: joe@perches.com) by omf11.hostedemail.com (Postfix) with ESMTPA; Wed, 8 Feb 2017 19:53:30 +0000 (UTC) Message-ID: <1486583609.27834.21.camel@perches.com> Subject: Re: [RFC 19/19] checkpatch: warn for use of old PCI pool API From: Joe Perches To: Peter Senna Tschudin , Romain Perier Cc: Dan Williams , Doug Ledford , Sean Hefty , Hal Rosenstock , jeffrey.t.kirsher@intel.com, "David S. Miller" , stas.yakovlev@gmail.com, "James E.J. Bottomley" , "Martin K. Petersen" , Felipe Balbi , Greg Kroah-Hartman , linux-rdma@vger.kernel.org, netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Senna Tschudin Date: Wed, 08 Feb 2017 11:53:29 -0800 In-Reply-To: <20170208185550.GS16878@collabora.com> References: <20170208163457.28853-1-romain.perier@collabora.com> <20170208163457.28853-20-romain.perier@collabora.com> <20170208185550.GS16878@collabora.com> X-Mailer: Evolution 3.22.3-0ubuntu0.1 Mime-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, 2017-02-08 at 19:55 +0100, Peter Senna Tschudin wrote: > On Wed, Feb 08, 2017 at 05:34:57PM +0100, Romain Perier wrote: > > pci_pool_*() functions should be replaced by the corresponding functions > > in the DMA pool API. This adds support to check for use of these pci > > functions and display a warning when it is the case. > > Don't know if relevant, but did not catch the struct. Other than that > works fine. > > > > > Signed-off-by: Romain Perier > > --- > > scripts/checkpatch.pl | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > > index 8e96af5..026920e 100755 > > --- a/scripts/checkpatch.pl > > +++ b/scripts/checkpatch.pl > > @@ -6058,6 +6058,11 @@ sub process { > > WARN("USE_DEVICE_INITCALL", > > "please use device_initcall() or more appropriate function instead of __initcall() (see include/linux/init.h)\n" . $herecurr); > > } > > +# check for old PCI api pci_pool_*(), use dma_pool_*() instead > > + if ($line =~ /\bpci_pool_.+\(/) { > > + WARN("USE_PCI_POOL", > > + "please use the dma pool api or more appropriate function instead of the old pci pool api\n" . $herecurr); > > + } > > > > # check for various structs that are normally const (ops, kgdb, device_tree) > > if ($line !~ /\bconst\b/ && > > -- > > 2.9.3 > > Did this patch get to lkml? Perhaps this would be more complete:  scripts/checkpatch.pl | 9 +++++++++  1 file changed, 9 insertions(+) --- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 8e96af53611c..600f81cc1ec1 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -6059,6 +6059,15 @@ sub process {        "please use device_initcall() or more appropriate function instead of __initcall() (see include/linux/init.h)\n" . $herecurr);   }   +# check for old PCI api pci_pool_*(), use dma_pool_*() instead + if ($line =~ /\bpci_pool(?:_(?:create|destroy|alloc|zalloc|free)|)\b/) { + if (WARN("USE_DMA_POOL", +  "please use the dma pool api or more appropriate function instead of the old pci pool api\n" . $herecurr) && +     $fix) { + while ($fixed[$fixlinenr] =~ s/\bpci_pool(_(?:create|destroy|alloc|zalloc|free)|)\b/dma_pool$1/) {} + } + } +  # check for various structs that are normally const (ops, kgdb, device_tree)   if ($line !~ /\bconst\b/ &&       $line =~ /\bstruct\s+($const_structs)\b/) {