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

Vinod Koul vkoul at kernel.org
Tue Dec 16 05:11:44 PST 2025


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!

-- 
~Vinod



More information about the linux-arm-kernel mailing list