mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhi Wang <zhiw@nvidia.com>
To: <ojeda@kernel.org>, <alex.gaynor@gmail.com>
Cc: <boqun.feng@gmail.com>, <gary@garyguo.net>,
	<bjorn3_gh@protonmail.com>, <lossin@kernel.org>,
	<a.hindborg@kernel.org>, <aliceryhl@google.com>,
	<tmgross@umich.edu>, <dakr@kernel.org>,
	<rust-for-linux@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Zhi Wang <zhiw@nvidia.com>
Subject: [PATCH] rust: list: remove nonexistent insert_at() from the comments
Date: Sat, 2 Aug 2025 21:00:01 +0000	[thread overview]
Message-ID: <20250802210001.824022-1-zhiw@nvidia.com> (raw)

The insert_at() method was never introduced in the code. Remove it from
the comments to avoid confusion.

No functional change intended.

Fixes: 52ae96f5187c ("rust: list: make the cursor point between elements")
Signed-off-by: Zhi Wang <zhiw@nvidia.com>
---
 rust/kernel/list.rs | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/rust/kernel/list.rs b/rust/kernel/list.rs
index 44e5219cfcbc..f40eaa17a8fc 100644
--- a/rust/kernel/list.rs
+++ b/rust/kernel/list.rs
@@ -761,19 +761,6 @@ fn next(&mut self) -> Option<ArcBorrow<'a, T>> {
 ///     out
 /// }
 ///
-/// // Use a cursor to insert a value at a specific index. Returns an error if the index is out of
-/// // bounds.
-/// fn insert_at(list: &mut List<ListItem>, new: ListArc<ListItem>, idx: usize) -> Result {
-///     let mut cursor = list.cursor_front();
-///     for _ in 0..idx {
-///         if !cursor.move_next() {
-///             return Err(EINVAL);
-///         }
-///     }
-///     cursor.insert_next(new);
-///     Ok(())
-/// }
-///
 /// // Merge two sorted lists into a single sorted list.
 /// fn merge_sorted(list: &mut List<ListItem>, merge: List<ListItem>) {
 ///     let mut cursor = list.cursor_front();
@@ -799,8 +786,6 @@ fn next(&mut self) -> Option<ArcBorrow<'a, T>> {
 /// // [14, 10, 15, 14]
 /// assert!(remove_first(&mut list, 14).is_some());
 /// // [10, 15, 14]
-/// insert_at(&mut list, ListItem::new(12)?, 2)?;
-/// // [10, 15, 12, 14]
 /// assert!(remove_last(&mut list, 15).is_some());
 /// // [10, 12, 14]
 ///
-- 
2.43.5


             reply	other threads:[~2025-08-02 21:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-02 21:00 Zhi Wang [this message]
2025-08-02 21:31 ` Miguel Ojeda
2025-08-03  6:42   ` Zhi Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250802210001.824022-1-zhiw@nvidia.com \
    --to=zhiw@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®