From: Robin Murphy <robin.murphy@arm.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
James.Bottomley@HansenPartnership.com, deller@gmx.de,
sudipm.mukherjee@gmail.com, sumit.semwal@linaro.org,
christian.koenig@amd.com
Cc: linux-parisc@vger.kernel.org, linux-media@vger.kernel.org,
dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] parisc/parport_gsc: switch from 'pci_' to 'dma_' API
Date: Tue, 24 Aug 2021 11:24:54 +0100 [thread overview]
Message-ID: <1a6f5b12-7cf2-cdb8-7a60-20c2d2ee38f3@arm.com> (raw)
In-Reply-To: <93b21629db55629ec3d384e8184c4a9dd0270c11.1629754126.git.christophe.jaillet@wanadoo.fr>
On 2021-08-23 22:30, Christophe JAILLET wrote:
> The wrappers in include/linux/pci-dma-compat.h should go away.
>
> The patch has been generated with the coccinelle script below.
>
> @@
> expression e1, e2, e3, e4;
> @@
> - pci_free_consistent(e1, e2, e3, e4)
> + dma_free_coherent(&e1->dev, e2, e3, e4)
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> If needed, see post from Christoph Hellwig on the kernel-janitors ML:
> https://marc.info/?l=kernel-janitors&m=158745678307186&w=4
>
> This has *NOT* been compile tested because I don't have the needed
> configuration.
> ssdfs
> ---
> drivers/parport/parport_gsc.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c
> index 1e43b3f399a8..db912fa6b6df 100644
> --- a/drivers/parport/parport_gsc.c
> +++ b/drivers/parport/parport_gsc.c
> @@ -390,9 +390,8 @@ static int __exit parport_remove_chip(struct parisc_device *dev)
> if (p->irq != PARPORT_IRQ_NONE)
> free_irq(p->irq, p);
> if (priv->dma_buf)
> - pci_free_consistent(priv->dev, PAGE_SIZE,
> - priv->dma_buf,
> - priv->dma_handle);
> + dma_free_coherent(&priv->dev->dev, PAGE_SIZE,
> + priv->dma_buf, priv->dma_handle);
Hmm, seeing a free on its own made me wonder where the corresponding
alloc was, but on closer inspection it seems there isn't one. AFAICS
priv->dma_buf is only ever assigned with NULL (and priv->dev doesn't
seem to be assigned at all), so this could likely just be removed. In
fact it looks like all the references to DMA in this driver are just
copy-paste from parport_pc and unused.
Robin.
> kfree (p->private_data);
> parport_put_port(p);
> kfree (ops); /* hope no-one cached it */
>
next prev parent reply other threads:[~2021-08-24 10:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-23 21:30 [PATCH] parisc/parport_gsc: switch from 'pci_' to 'dma_' API Christophe JAILLET
2021-08-24 10:24 ` Robin Murphy [this message]
2021-08-24 19:39 ` Christophe JAILLET
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=1a6f5b12-7cf2-cdb8-7a60-20c2d2ee38f3@arm.com \
--to=robin.murphy@arm.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=christian.koenig@amd.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=sudipm.mukherjee@gmail.com \
--cc=sumit.semwal@linaro.org \
/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).