Re: [PATCH v2 06/19] dmaengine: dw-edma: Move callback result helper before LL helpers
Frank Li <[email protected]>
| Newsgroups | org.kernel.vger.dmaengine,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <amJGq2aPpEMPc9uY@SMW015318> |
On Thu, Jul 23, 2026 at 05:41:37PM +0900, Koichiro Den wrote: > From: Frank Li <[email protected]> > > Move dw_hdma_set_callback_result() next to the descriptor helpers so > linked-list completion and reset code can use it without a forward > declaration. > > No functional change. > > Signed-off-by: Frank Li <[email protected]> > Signed-off-by: Koichiro Den <[email protected]> > --- Reviewed-by: Frank Li <[email protected]> > Based on Frank's original submission: > https://lore.kernel.org/dmaengine/[email protected]/ > > Changes in v2: > - Move the helper before the LL helpers so later patches do not need > another relocation. > > drivers/dma/dw-edma/dw-edma-core.c | 50 +++++++++++++++--------------- > 1 file changed, 25 insertions(+), 25 deletions(-) > > diff --git a/drivers/dma/dw-edma/dw-edma-core.c b/drivers/dma/dw-edma/dw-edma-core.c > index 78d1bb6302fb..29f78405e9fb 100644 > --- a/drivers/dma/dw-edma/dw-edma-core.c > +++ b/drivers/dma/dw-edma/dw-edma-core.c > @@ -73,6 +73,31 @@ static void vchan_free_desc(struct virt_dma_desc *vdesc) > kfree(vd2dw_edma_desc(vdesc)); > } > > +static void dw_hdma_set_callback_result(struct virt_dma_desc *vd, > + enum dmaengine_tx_result result) > +{ > + u32 residue = 0; > + struct dw_edma_desc *desc; > + struct dmaengine_result *res; > + > + if (!vd->tx.callback_result) > + return; > + > + desc = vd2dw_edma_desc(vd); > + if (desc) { > + residue = desc->alloc_sz; > + > + if (result == DMA_TRANS_NOERROR) > + residue -= desc->burst[desc->start_burst - 1].xfer_sz; > + else if (desc->done_burst) > + residue -= desc->burst[desc->done_burst - 1].xfer_sz; > + } > + > + res = &vd->tx_result; > + res->result = result; > + res->residue = residue; > +} > + > static void dw_edma_core_reset_ll(struct dw_edma_chan *chan) > { > u32 i; > @@ -645,31 +670,6 @@ dw_edma_device_prep_interleaved_dma(struct dma_chan *dchan, > return dw_edma_device_transfer(&xfer, dw_edma_device_get_config(dchan, NULL)); > } > > -static void dw_hdma_set_callback_result(struct virt_dma_desc *vd, > - enum dmaengine_tx_result result) > -{ > - u32 residue = 0; > - struct dw_edma_desc *desc; > - struct dmaengine_result *res; > - > - if (!vd->tx.callback_result) > - return; > - > - desc = vd2dw_edma_desc(vd); > - if (desc) { > - residue = desc->alloc_sz; > - > - if (result == DMA_TRANS_NOERROR) > - residue -= desc->burst[desc->start_burst - 1].xfer_sz; > - else if (desc->done_burst) > - residue -= desc->burst[desc->done_burst - 1].xfer_sz; > - } > - > - res = &vd->tx_result; > - res->result = result; > - res->residue = residue; > -} > - > static void dw_edma_done_interrupt(struct dw_edma_chan *chan) > { > struct dw_edma_desc *desc; > -- > 2.51.0 >