Skip to content

Commit d67bf16

Browse files
nbdd0121ojeda
authored andcommitted
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>
1 parent b4d97d0 commit d67bf16

2 files changed

Lines changed: 0 additions & 14 deletions

File tree

rust/kernel/dma.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,12 +1210,6 @@ macro_rules! dma_write {
12101210
(@parse [$dma:expr] [$($proj:tt)*] [[$flavor:ident: $index:expr] $($rest:tt)*]) => {
12111211
$crate::dma_write!(@parse [$dma] [$($proj)* [$flavor: $index]] [$($rest)*])
12121212
};
1213-
(@parse [$dma:expr] [$($proj:tt)*] [[$index:expr]? $($rest:tt)*]) => {
1214-
$crate::dma_write!(@parse [$dma] [$($proj)* [$index]?] [$($rest)*])
1215-
};
1216-
(@parse [$dma:expr] [$($proj:tt)*] [[$index:expr] $($rest:tt)*]) => {
1217-
$crate::dma_write!(@parse [$dma] [$($proj)* [$index]] [$($rest)*])
1218-
};
12191213
($dma:expr, $($rest:tt)*) => {
12201214
$crate::dma_write!(@parse [$dma] [] [$($rest)*])
12211215
};

rust/kernel/ptr/projection.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,6 @@ macro_rules! project_pointer {
351351
$crate::ptr::project!(@gen $ptr, $($rest)*)
352352
};
353353

354-
// For compatibility
355-
(@gen $ptr:ident, [$index:expr]? $($rest:tt)*) => {
356-
$crate::ptr::project!(@gen $ptr, [try: $index] $($rest)*)
357-
};
358-
(@gen $ptr:ident, [$index:expr] $($rest:tt)*) => {
359-
$crate::ptr::project!(@gen $ptr, [build: $index] $($rest)*)
360-
};
361-
362354
(mut $ptr:expr, $($proj:tt)*) => {{
363355
let ptr: *mut _ = $ptr;
364356
$crate::ptr::project!(@gen ptr, $($proj)*);

0 commit comments

Comments
 (0)