]> git.ipfire.org Git - thirdparty/linux.git/commit
rust: dma: add dma_handle_with_offset method to CoherentAllocation
authorAlexandre Courbot <acourbot@nvidia.com>
Thu, 19 Jun 2025 13:23:47 +0000 (22:23 +0900)
committerDanilo Krummrich <dakr@kernel.org>
Mon, 23 Jun 2025 15:11:07 +0000 (17:11 +0200)
commit26af856539842a4107c821e133fdda896022737f
tree09fb9c6d776036c0c18ad391b3ab1e41dac0c038
parentc0a3065d5def59a894afc8cf5e988396cd0c2f5e
rust: dma: add dma_handle_with_offset method to CoherentAllocation

Sometimes one may want to obtain a DMA handle starting at a given
offset. This can be done by adding said offset to the result of
`dma_handle()`, but doing so on the client side carries the risk that
the operation will go outside the bounds of the allocation.

Thus, add a `dma_handle_with_offset` method that adds the desired offset
after checking that it is still valid.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Link: https://lore.kernel.org/r/20250619-nova-frts-v6-3-ecf41ef99252@nvidia.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/dma.rs