]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rust: list: extract common code for insertion
authorAlice Ryhl <aliceryhl@google.com>
Mon, 10 Feb 2025 09:53:35 +0000 (09:53 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Sat, 8 Mar 2025 21:35:34 +0000 (22:35 +0100)
commit998c65733b95e8de45cbc10aa8d69652d15fa9d3
tree7630a96deea4a3901ce5d7225bcea3f97edb7734
parent6ad64bf91728502fe8a4d1419c0a3e4fd323f503
rust: list: extract common code for insertion

To prepare for a new cursor API that has the ability to insert elements
into the list, extract the common code needed for this operation into a
new `insert_inner` method.

Both `push_back` and `push_front` are updated to use the new function.

Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20250210-cursor-between-v7-1-36f0215181ed@google.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/list.rs