[PATCH v2] rust: dma: remove incorrect safety documentation

Yilin Chen posted 1 patch 1 month, 1 week ago
rust/kernel/dma.rs | 2 --
1 file changed, 2 deletions(-)
[PATCH v2] rust: dma: remove incorrect safety documentation
Posted by Yilin Chen 1 month, 1 week ago
Removes a safety requirement that incorrectly states callers must
ensure the device does not access memory while the returned slice
is live, as this method doesn't return a slice.

Signed-off-by: Yilin Chen <1479826151@qq.com>
---
Changes in v2:
- Use real name in signed-off-by line (Kari Argillander)
- Link to v1: https://lore.kernel.org/rust-for-linux/tencent_7183098292B42248DA2FAE7C8EA39E3B1A09@qq.com/
---
 rust/kernel/dma.rs | 2 --
 1 file changed, 2 deletions(-)

diff --git a/rust/kernel/dma.rs b/rust/kernel/dma.rs
index 84d3c67269e8..2ac107d8f7b7 100644
--- a/rust/kernel/dma.rs
+++ b/rust/kernel/dma.rs
@@ -532,8 +532,6 @@ pub unsafe fn as_slice_mut(&mut self, offset: usize, count: usize) -> Result<&mu
     ///
     /// # Safety
     ///
-    /// * Callers must ensure that the device does not read/write to/from memory while the returned
-    ///   slice is live.
     /// * Callers must ensure that this call does not race with a read or write to the same region
     ///   that overlaps with this write.
     ///
-- 
2.34.1
Re: [PATCH v2] rust: dma: remove incorrect safety documentation
Posted by Danilo Krummrich 1 month, 1 week ago
On Sun Dec 28, 2025 at 5:52 PM CET, Yilin Chen wrote:
> Removes a safety requirement that incorrectly states callers must
> ensure the device does not access memory while the returned slice
> is live, as this method doesn't return a slice.
>

Fixes: d37a39f607c4 ("rust: dma: add as_slice/write functions for CoherentAllocation")

> Signed-off-by: Yilin Chen <1479826151@qq.com>

Applied to driver-core-linus, thanks!

For future submissions, please remember to add a 'Fixes:' tag when appropriate.

Please also make sure to use scripts/get_maintainer.pl and also Cc reviewers.