[PATCH 4/4] rust: dma: remove old dma_{read,write} macro compatibility syntax
From: Gary Guo
Date: Sat Feb 14 2026 - 00:35:38 EST
With users converted, the old compatibility syntax can be removed.
Signed-off-by: Gary Guo <gary@xxxxxxxxxxx>
---
rust/kernel/dma.rs | 20 --------------------
1 file changed, 20 deletions(-)
diff --git a/rust/kernel/dma.rs b/rust/kernel/dma.rs
index 2338dc6b9374..f55033264849 100644
--- a/rust/kernel/dma.rs
+++ b/rust/kernel/dma.rs
@@ -706,18 +706,6 @@ unsafe impl<T: AsBytes + FromBytes + Send> Send for CoherentAllocation<T> {}
/// ```
#[macro_export]
macro_rules! dma_read {
- // Compatibility for old syntax.
- ($dma:ident [ $idx:expr ] $($proj:tt)* ) => {
- (|| -> ::core::result::Result<_, $crate::error::Error> {
- ::core::result::Result::Ok($crate::dma_read!($dma, [$idx]? $($proj)*))
- })
- };
- ($($dma:ident).* [ $idx:expr ] $($proj:tt)* ) => {
- (|| -> ::core::result::Result<_, $crate::error::Error> {
- ::core::result::Result::Ok($crate::dma_write!($($dma).*, [$idx]? $($proj)*))
- })
- };
-
($dma:expr, $($proj:tt)*) => {{
let ptr = $crate::project_pointer!(
$crate::dma::CoherentAllocation::as_ptr(&$dma), $($proj)*
@@ -754,14 +742,6 @@ macro_rules! dma_read {
/// ```
#[macro_export]
macro_rules! dma_write {
- // Compatibility for old syntax.
- ($dma:ident [ $idx:expr ] $(.$field:ident)* = $val:expr) => {
- (|| -> ::core::result::Result<_, $crate::error::Error> {
- $crate::dma_write!($dma, [$idx]? $(.$field)*, $val);
- ::core::result::Result::Ok(())
- })()
- };
-
(@parse [$dma:expr] [$($proj:tt)*] [, $val:expr]) => {
let ptr = $crate::project_pointer!(
mut $crate::dma::CoherentAllocation::as_mut_ptr(&$dma), $($proj)*
--
2.51.2