From: Joe Perches <joe@perches.com>
To: Peter Senna Tschudin <peter.senna@collabora.com>,
Romain Perier <romain.perier@collabora.com>
Cc: Dan Williams <dan.j.williams@intel.com>,
Doug Ledford <dledford@redhat.com>,
Sean Hefty <sean.hefty@intel.com>,
Hal Rosenstock <hal.rosenstock@gmail.com>,
jeffrey.t.kirsher@intel.com,
"David S. Miller" <davem@davemloft.net>,
stas.yakovlev@gmail.com,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
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 <peter.senna@collabora.co.uk>
Subject: Re: [RFC 19/19] checkpatch: warn for use of old PCI pool API
Date: Wed, 08 Feb 2017 11:53:29 -0800 [thread overview]
Message-ID: <1486583609.27834.21.camel@perches.com> (raw)
In-Reply-To: <20170208185550.GS16878@collabora.com>
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 <romain.perier@collabora.com>
> > ---
> > 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(+)
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/) {
next prev parent reply other threads:[~2017-02-08 19:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170208163457.28853-1-romain.perier@collabora.com>
[not found] ` <20170208163457.28853-2-romain.perier@collabora.com>
2017-02-08 18:20 ` [RFC 01/19] block: DAC960: Replace PCI pool old API Peter Senna Tschudin
[not found] ` <20170208163457.28853-3-romain.perier@collabora.com>
2017-02-08 18:21 ` [RFC 02/19] dmaengine: pch_dma: " Peter Senna Tschudin
[not found] ` <20170208163457.28853-4-romain.perier@collabora.com>
[not found] ` <20170208163457.28853-4-romain.perier-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2017-02-08 18:22 ` [RFC 03/19] IB/mthca: " Peter Senna Tschudin
[not found] ` <20170208163457.28853-5-romain.perier@collabora.com>
[not found] ` <20170208163457.28853-5-romain.perier-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2017-02-08 18:23 ` [RFC 04/19] net: e100: " Peter Senna Tschudin
[not found] ` <20170208163457.28853-6-romain.perier@collabora.com>
2017-02-08 18:24 ` [RFC 05/19] mlx4: " Peter Senna Tschudin
[not found] ` <20170208163457.28853-7-romain.perier@collabora.com>
2017-02-08 18:26 ` [RFC 06/19] mlx5: " Peter Senna Tschudin
[not found] ` <20170208163457.28853-8-romain.perier@collabora.com>
2017-02-08 18:27 ` [RFC 07/19] wireless: ipw2200: " Peter Senna Tschudin
[not found] ` <20170208163457.28853-9-romain.perier@collabora.com>
2017-02-08 18:28 ` [RFC 08/19] scsi: be2iscsi: " Peter Senna Tschudin
[not found] ` <20170208163457.28853-10-romain.perier@collabora.com>
2017-02-08 18:29 ` [RFC 09/19] scsi: csiostor: " Peter Senna Tschudin
[not found] ` <20170208163457.28853-11-romain.perier@collabora.com>
2017-02-08 18:32 ` [RFC 10/19] scsi: lpfc: " Peter Senna Tschudin
[not found] ` <20170208163457.28853-12-romain.perier@collabora.com>
2017-02-08 18:37 ` [RFC 11/19] scsi: megaraid: " Peter Senna Tschudin
[not found] ` <20170208163457.28853-13-romain.perier@collabora.com>
2017-02-08 18:40 ` [RFC 12/19] scsi: mpt3sas: " Peter Senna Tschudin
[not found] ` <20170208163457.28853-14-romain.perier@collabora.com>
2017-02-08 18:42 ` [RFC 13/19] scsi: mvsas: " Peter Senna Tschudin
[not found] ` <20170208163457.28853-15-romain.perier@collabora.com>
2017-02-08 18:42 ` [RFC 14/19] scsi: pmcraid: " Peter Senna Tschudin
[not found] ` <20170208163457.28853-16-romain.perier@collabora.com>
2017-02-08 18:43 ` [RFC 15/19] usb: gadget: amd5536udc: " Peter Senna Tschudin
[not found] ` <20170208163457.28853-17-romain.perier@collabora.com>
2017-02-08 18:45 ` [RFC 16/19] usb: gadget: net2280: " Peter Senna Tschudin
[not found] ` <20170208163457.28853-18-romain.perier@collabora.com>
2017-02-08 18:45 ` [RFC 17/19] usb: gadget: pch_udc: " Peter Senna Tschudin
[not found] ` <20170208163457.28853-19-romain.perier@collabora.com>
2017-02-08 18:49 ` [RFC 18/19] PCI: Remove PCI pool macro functions Peter Senna Tschudin
[not found] ` <20170208163457.28853-20-romain.perier@collabora.com>
2017-02-08 18:55 ` [RFC 19/19] checkpatch: warn for use of old PCI pool API Peter Senna Tschudin
2017-02-08 19:53 ` Joe Perches [this message]
[not found] ` <20170208163457.28853-1-romain.perier-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2017-02-08 19:00 ` [RFC 00/19] Replace PCI pool by DMA " Peter Senna Tschudin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1486583609.27834.21.camel@perches.com \
--to=joe@perches.com \
--cc=balbi@kernel.org \
--cc=dan.j.williams@intel.com \
--cc=davem@davemloft.net \
--cc=dledford@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=hal.rosenstock@gmail.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=netdev@vger.kernel.org \
--cc=peter.senna@collabora.co.uk \
--cc=peter.senna@collabora.com \
--cc=romain.perier@collabora.com \
--cc=sean.hefty@intel.com \
--cc=stas.yakovlev@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).