Skip to contentSkip to conversation

rust: list: fix path of `assert_pinned!`

PATCH Applied Benno Lossin 2 participants 7 messages May 25, 2025 – May 26, 2025 Rust

lore
Share & tools
lore

Benno Lossin

author reviewer
#0 lore raw

PATCH 1/1 rust: list: fix path of `assert_pinned!`

Commit dbd5058ba60c ("rust: make pin-init its own crate") moved all items from pin-init into the pin-init crate, including the assert_pinned! macro.

Thus fix the path.

This occurrence was missed in that commit, since it has no current users, although binder does.

Cc [email protected] # I haven't found the commit in stable yet, but just to be sure.
Fixes dbd5058ba60c ("rust: make pin-init its own crate")
---
 rust/kernel/list/arc.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/list/arc.rs +1 -1
index 13c50df37b89..a88a2dc65aa7 100644
@@ -96,7 +96,7 @@ unsafe fn on_drop_list_arc(&self) {}
     } $($rest:tt)*) => {
         impl$(<$($generics)*>)? $crate::list::ListArcSafe<$num> for $t {
             unsafe fn on_create_list_arc_from_unique(self: ::core::pin::Pin<&mut Self>) {
-                $crate::assert_pinned!($t, $field, $fty, inline);
+                ::pin_init::assert_pinned!($t, $field, $fty, inline);
 
                 // SAFETY: This field is structurally pinned as per the above assertion.
                 let field = unsafe {

base-commit: f26449565019315650c9fe87743b10103910ca6b

Signature · 1 line
2.49.0
author reviewer
#1 lore raw
Quoted 8 lines · Benno Lossin

Commit dbd5058ba60c ("rust: make pin-init its own crate") moved all items from pin-init into the pin-init crate, including the assert_pinned! macro.

Thus fix the path.

This occurrence was missed in that commit, since it has no current users, although binder does.

Aw damn, I edited the message, but forgot to regenerate the .patch file... here is the edited version:

Commit dbd5058ba60c ("rust: make pin-init its own crate") moved all items from pin-init into the pin-init crate, including the assert_pinned! macro.

Thus fix the path of the sole user of the assert_pinned! macro.

This occurrence was missed in the commit above, since it is in a macro has no current users (although binder is a future user).

---
Cheers,
Benno

Quoted 22 lines
Cc [email protected] # I haven't found the commit in stable yet, but just to be sure.
Fixes dbd5058ba60c ("rust: make pin-init its own crate")
---
 rust/kernel/list/arc.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/list/arc.rs +1 -1
index 13c50df37b89..a88a2dc65aa7 100644
@@ -96,7 +96,7 @@ unsafe fn on_drop_list_arc(&self) {}
     } $($rest:tt)*) => {
         impl$(<$($generics)*>)? $crate::list::ListArcSafe<$num> for $t {
             unsafe fn on_create_list_arc_from_unique(self: ::core::pin::Pin<&mut Self>) {
-                $crate::assert_pinned!($t, $field, $fty, inline);
+                ::pin_init::assert_pinned!($t, $field, $fty, inline);
 
                 // SAFETY: This field is structurally pinned as per the above assertion.
                 let field = unsafe {

base-commit: f26449565019315650c9fe87743b10103910ca6b

#2 lore raw
Quoted 3 lines · Benno Lossin

This occurrence was missed in the commit above, since it is in a macro has no current users (although binder is a future user).

"since it is in a macro <rule that> has no current users"?

Cheers,
Miguel

#3 lore raw
Quoted 2 lines · Miguel Ojeda

"since it is in a macro <rule that> has no current users"?

i.e. the macro has uses, but not the tracked_by rule in particular, right?

Cheers,
Miguel

author reviewer
#4 lore raw
Quoted 6 lines · Miguel Ojeda
Quoted 2 lines · Miguel Ojeda

"since it is in a macro <rule that> has no current users"?

i.e. the macro has uses, but not the tracked_by rule in particular, right?

Oh yeah that's correct.

---
Cheers,
Benno

Applied
#5 lore raw
In reply to Benno Lossin
Quoted 5 lines · Benno Lossin

Commit dbd5058ba60c ("rust: make pin-init its own crate") moved all items from pin-init into the pin-init crate, including the assert_pinned! macro.

Quoted 8 lines

Thus fix the path.

This occurrence was missed in that commit, since it has no current users, although binder does.

Cc [email protected] # I haven't found the commit in stable yet, but just to be sure.
Fixes dbd5058ba60c ("rust: make pin-init its own crate")

Applied to rust-next -- thanks!

[ Reworded slightly as discussed in the list. - Miguel ]

The commit is in v6.15 (rather than just in e.g. rust-next), so it should indeed have the Cc: stable (I removed the suffix).

Thanks!

Cheers,
Miguel

author reviewer
#6 lore raw
Quoted 15 lines · Miguel Ojeda
Quoted 5 lines · Benno Lossin

Commit dbd5058ba60c ("rust: make pin-init its own crate") moved all items from pin-init into the pin-init crate, including the assert_pinned! macro.

Quoted 8 lines

Thus fix the path.

This occurrence was missed in that commit, since it has no current users, although binder does.

Cc [email protected] # I haven't found the commit in stable yet, but just to be sure.
Fixes dbd5058ba60c ("rust: make pin-init its own crate")
Quoted 6 lines

Applied to rust-next -- thanks!

[ Reworded slightly as discussed in the list. - Miguel ]

The commit is in v6.15 (rather than just in e.g. rust-next), so it should indeed have the Cc: stable (I removed the suffix).

Yes, at the time of writing the commit, I hadn't pulled from Linus' tree & the stable trees.

Thanks!

---
Cheers,
Benno