Commit 9e626edd authored by Tamir Duberstein's avatar Tamir Duberstein Committed by Miguel Ojeda
Browse files

rust: list: use consistent self parameter name



Refer to the self parameter of `impl_list_item!` by the same name used
in `impl_has_list_links{,_self_ptr}!`.

Reviewed-by: default avatarChristian Schrefl <chrisi.schrefl@gmail.com>
Tested-by: default avatarAlice Ryhl <aliceryhl@google.com>
Reviewed-by: default avatarAlice Ryhl <aliceryhl@google.com>
Signed-off-by: default avatarTamir Duberstein <tamird@gmail.com>
Link: https://lore.kernel.org/r/20250709-list-no-offset-v4-3-a429e75840a9@gmail.com


Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent 9cec86e4
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -114,12 +114,12 @@ unsafe fn raw_get_list_links(ptr: *mut Self) -> *mut $crate::list::ListLinks$(<$
#[macro_export]
macro_rules! impl_list_item {
    (
        $(impl$({$($generics:tt)*})? ListItem<$num:tt> for $t:ty {
        $(impl$({$($generics:tt)*})? ListItem<$num:tt> for $self:ty {
            using ListLinks;
        })*
    ) => {$(
        // SAFETY: See GUARANTEES comment on each method.
        unsafe impl$(<$($generics)*>)? $crate::list::ListItem<$num> for $t {
        unsafe impl$(<$($generics)*>)? $crate::list::ListItem<$num> for $self {
            // GUARANTEES:
            // * This returns the same pointer as `prepare_to_insert` because `prepare_to_insert`
            //   is implemented in terms of `view_links`.
@@ -178,12 +178,12 @@ unsafe fn post_remove(me: *mut $crate::list::ListLinks<$num>) -> *const Self {
    )*};

    (
        $(impl$({$($generics:tt)*})? ListItem<$num:tt> for $t:ty {
        $(impl$({$($generics:tt)*})? ListItem<$num:tt> for $self:ty {
            using ListLinksSelfPtr;
        })*
    ) => {$(
        // SAFETY: See GUARANTEES comment on each method.
        unsafe impl$(<$($generics)*>)? $crate::list::ListItem<$num> for $t {
        unsafe impl$(<$($generics)*>)? $crate::list::ListItem<$num> for $self {
            // GUARANTEES:
            // This implementation of `ListItem` will not give out exclusive access to the same
            // `ListLinks` several times because calls to `prepare_to_insert` and `post_remove`