]> git.ipfire.org Git - thirdparty/linux.git/commit
scatterlist: introduce sg_nents_for_dma() helper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 8 Jan 2026 10:50:12 +0000 (11:50 +0100)
committerVinod Koul <vkoul@kernel.org>
Fri, 9 Jan 2026 03:06:00 +0000 (08:36 +0530)
commit80c70bfb95cdbe0c644070f4ca4754a60f0a4830
tree79398b6fe665c89718f850cbfecef15e12bb7083
parentfe7b87d908da33326fbf6fe2b3830426432ec66c
scatterlist: introduce sg_nents_for_dma() helper

Sometimes the user needs to split each entry on the mapped scatter list
due to DMA length constrains. This helper returns a number of entities
assuming that each of them is not bigger than supplied maximum length.

Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260108105619.3513561-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
include/linux/scatterlist.h
lib/scatterlist.c