mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Fourier <fourier.thomas@gmail.com>
Cc: Thomas Fourier <fourier.thomas@gmail.com>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
	"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
	Shrikanth Hegde <sshegde@linux.ibm.com>,
	Olof Johansson <olof@lixom.net>, Jeff Garzik <jeff@garzik.org>,
	linuxppc-dev@lists.ozlabs.org (open list:LINUX FOR POWERPC
	(32-BIT AND 64-BIT)), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v2] powerpc/pasemi: Remove pasemi_dma_alloc_buf() and pasemi_dma_free_buf()
Date: Fri, 27 Nov 2026 10:11:55 +0100	[thread overview]
Message-ID: <20261127091206.13045-2-fourier.thomas@gmail.com> (raw)

dma_free_coherent() is called with the wrong arguments. The two last
arguments must be the virtual address and the DMA address but the
DMA address and the allocation flags are passed. If this function were
called, it would call kfree() on a DMA address and dma_unmap() on the
allocation flag.

Remove pasemi_dma_alloc_buf() and pasemi_dma_free_buf() as these
functions are not used.

Fixes: 8ee9d8577935 ("pasemi: DMA engine management library")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
---
v1->v2:
  - remove the functions instead of fixing them

 arch/powerpc/include/asm/pasemi_dma.h   |  5 ----
 arch/powerpc/platforms/pasemi/dma_lib.c | 31 -------------------------
 2 files changed, 36 deletions(-)

diff --git a/arch/powerpc/include/asm/pasemi_dma.h b/arch/powerpc/include/asm/pasemi_dma.h
index 712a0b32120f..bb2c347dfec2 100644
--- a/arch/powerpc/include/asm/pasemi_dma.h
+++ b/arch/powerpc/include/asm/pasemi_dma.h
@@ -505,11 +505,6 @@ extern int pasemi_dma_stop_chan(const struct pasemi_dmachan *chan);
 extern int pasemi_dma_alloc_ring(struct pasemi_dmachan *chan, int ring_size);
 extern void pasemi_dma_free_ring(struct pasemi_dmachan *chan);
 
-extern void *pasemi_dma_alloc_buf(struct pasemi_dmachan *chan, int size,
-				  dma_addr_t *handle);
-extern void pasemi_dma_free_buf(struct pasemi_dmachan *chan, int size,
-				dma_addr_t *handle);
-
 /* Routines to allocate flags (events) for channel synchronization */
 extern int  pasemi_dma_alloc_flag(void);
 extern void pasemi_dma_free_flag(int flag);
diff --git a/arch/powerpc/platforms/pasemi/dma_lib.c b/arch/powerpc/platforms/pasemi/dma_lib.c
index 1be1f18f6f09..d6ce553c53bf 100644
--- a/arch/powerpc/platforms/pasemi/dma_lib.c
+++ b/arch/powerpc/platforms/pasemi/dma_lib.c
@@ -336,37 +336,6 @@ int pasemi_dma_stop_chan(const struct pasemi_dmachan *chan)
 }
 EXPORT_SYMBOL(pasemi_dma_stop_chan);
 
-/* pasemi_dma_alloc_buf - Allocate a buffer to use for DMA
- * @chan: Channel to allocate for
- * @size: Size of buffer in bytes
- * @handle: DMA handle
- *
- * Allocate a buffer to be used by the DMA engine for read/write,
- * similar to dma_alloc_coherent().
- *
- * Returns the virtual address of the buffer, or NULL in case of failure.
- */
-void *pasemi_dma_alloc_buf(struct pasemi_dmachan *chan, int size,
-			   dma_addr_t *handle)
-{
-	return dma_alloc_coherent(&dma_pdev->dev, size, handle, GFP_KERNEL);
-}
-EXPORT_SYMBOL(pasemi_dma_alloc_buf);
-
-/* pasemi_dma_free_buf - Free a buffer used for DMA
- * @chan: Channel the buffer was allocated for
- * @size: Size of buffer in bytes
- * @handle: DMA handle
- *
- * Frees a previously allocated buffer.
- */
-void pasemi_dma_free_buf(struct pasemi_dmachan *chan, int size,
-			 dma_addr_t *handle)
-{
-	dma_free_coherent(&dma_pdev->dev, size, handle, GFP_KERNEL);
-}
-EXPORT_SYMBOL(pasemi_dma_free_buf);
-
 /* pasemi_dma_alloc_flag - Allocate a flag (event) for channel synchronization
  *
  * Allocates a flag for use with channel synchronization (event descriptors).
-- 
2.53.0


                 reply	other threads:[~2026-11-27  9:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261127091206.13045-2-fourier.thomas@gmail.com \
    --to=fourier.thomas@gmail.com \
    --cc=chleroy@kernel.org \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=olof@lixom.net \
    --cc=ritesh.list@gmail.com \
    --cc=sshegde@linux.ibm.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

all inboxes | Powered by JetHome®