diff options
| author | Gary Guo <gary@garyguo.net> | 2026-06-02 15:17:57 +0100 |
|---|---|---|
| committer | Miguel Ojeda <ojeda@kernel.org> | 2026-06-05 10:16:47 +0200 |
| commit | ab0a321b4030b6e1fbbd99210bb7b5d4bc89d5e4 (patch) | |
| tree | af3ca057fade9d3c32533e616de5818b36e8045e /rust/kernel | |
| parent | 738a9213755ee13e0523192dfcc7c4f1d2b3f28c (diff) | |
rust: ptr: remove implicit index projection syntax
All users have been converted to use keyworded index projection syntax to
explicitly state their intention when doing index projection.
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Gary Guo <gary@garyguo.net>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patch.msgid.link/20260602-projection-syntax-rework-v2-6-6989470f5440@garyguo.net
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel')
| -rw-r--r-- | rust/kernel/dma.rs | 6 | ||||
| -rw-r--r-- | rust/kernel/ptr/projection.rs | 8 |
2 files changed, 0 insertions, 14 deletions
diff --git a/rust/kernel/dma.rs b/rust/kernel/dma.rs index d6382904a90d..642ccff465c8 100644 --- a/rust/kernel/dma.rs +++ b/rust/kernel/dma.rs @@ -1210,12 +1210,6 @@ macro_rules! dma_write { (@parse [$dma:expr] [$($proj:tt)*] [[$flavor:ident: $index:expr] $($rest:tt)*]) => { $crate::dma_write!(@parse [$dma] [$($proj)* [$flavor: $index]] [$($rest)*]) }; - (@parse [$dma:expr] [$($proj:tt)*] [[$index:expr]? $($rest:tt)*]) => { - $crate::dma_write!(@parse [$dma] [$($proj)* [$index]?] [$($rest)*]) - }; - (@parse [$dma:expr] [$($proj:tt)*] [[$index:expr] $($rest:tt)*]) => { - $crate::dma_write!(@parse [$dma] [$($proj)* [$index]] [$($rest)*]) - }; ($dma:expr, $($rest:tt)*) => { $crate::dma_write!(@parse [$dma] [] [$($rest)*]) }; diff --git a/rust/kernel/ptr/projection.rs b/rust/kernel/ptr/projection.rs index 8eae93f0d272..af72d3b0e2a3 100644 --- a/rust/kernel/ptr/projection.rs +++ b/rust/kernel/ptr/projection.rs @@ -351,14 +351,6 @@ macro_rules! project_pointer { $crate::ptr::project!(@gen $ptr, $($rest)*) }; - // For compatibility - (@gen $ptr:ident, [$index:expr]? $($rest:tt)*) => { - $crate::ptr::project!(@gen $ptr, [try: $index] $($rest)*) - }; - (@gen $ptr:ident, [$index:expr] $($rest:tt)*) => { - $crate::ptr::project!(@gen $ptr, [build: $index] $($rest)*) - }; - (mut $ptr:expr, $($proj:tt)*) => {{ let ptr: *mut _ = $ptr; $crate::ptr::project!(@gen ptr, $($proj)*); |
