[PATCH v4 0/13] dmaengine: introduce sg_nents_for_dma() and convert users

Vinod Koul vkoul at kernel.org
Thu Jan 8 18:17:30 PST 2026


On 08-01-26, 08:46, Andy Shevchenko wrote:
> On Tue, Dec 16, 2025 at 06:41:44PM +0530, Vinod Koul wrote:
> > On 24-11-25, 13:09, Andy Shevchenko wrote:
> > > A handful of the DMAengine drivers use same routine to calculate the number of
> > > SG entries needed for the given DMA transfer. Provide a common helper for them
> > > and convert.
> > > 
> > > I left the new helper on SG level of API because brief grepping shows potential
> > > candidates outside of DMA engine, e.g.:
> > > 
> > >   drivers/crypto/chelsio/chcr_algo.c:154:  nents += DIV_ROUND_UP(less, entlen);
> > >   drivers/spi/spi-stm32.c:1495:  /* Count the number of entries needed */
> > > 
> > > Changelog v4:
> > > - fixed compilation errors (Vinod)
> > 
> > :-(
> > 
> > drivers/dma/altera-msgdma.c: In function ‘msgdma_prep_slave_sg’:
> > drivers/dma/altera-msgdma.c:399:29: error: unused variable ‘sg’ [-Werror=unused-variable]
> > 
> > Clearly your script is not working. I am surprised that you are not able
> > to compile these changes. Bit disappointed tbh!
> 
> This is W=1 build with WERROR=y, yet I agree that I must have tested this as
> well. Sorry, I will do v5 with carefully tested all modules to be compiled
> with `make W=1`.

I turned on in by builds after it was enabled mainline... so yes now it
is part of my tests

-- 
~Vinod



More information about the linux-arm-kernel mailing list