Patch "rust: rbtree: fix `SAFETY` comments that should be `# Safety` sections" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    rust: rbtree: fix `SAFETY` comments that should be `# Safety` sections

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rust-rbtree-fix-safety-comments-that-should-be-safet.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 1191ea7186a652ddb6670ecbc54e681036618b6a
Author: Miguel Ojeda <ojeda@xxxxxxxxxx>
Date:   Wed Sep 4 22:43:41 2024 +0200

    rust: rbtree: fix `SAFETY` comments that should be `# Safety` sections
    
    [ Upstream commit 8333ff4d0799aafbe4275cddcbaf45e545e4efba ]
    
    The tag `SAFETY` is used for safety comments, i.e. `// SAFETY`, while a
    `Safety` section is used for safety preconditions in code documentation,
    i.e. `/// # Safety`.
    
    Fix the three instances recently added in `rbtree` that Clippy would
    have normally caught in a public item, so that we can enable checking
    of private items in one of the following commits.
    
    Fixes: 98c14e40e07a ("rust: rbtree: add cursor")
    Reviewed-by: Trevor Gross <tmgross@xxxxxxxxx>
    Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
    Tested-by: Gary Guo <gary@xxxxxxxxxxx>
    Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240904204347.168520-14-ojeda@xxxxxxxxxx
    Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/rust/kernel/rbtree.rs b/rust/kernel/rbtree.rs
index 25eb36fd1cdce..d03e4aa1f4812 100644
--- a/rust/kernel/rbtree.rs
+++ b/rust/kernel/rbtree.rs
@@ -884,7 +884,8 @@ fn get_neighbor_raw(&self, direction: Direction) -> Option<NonNull<bindings::rb_
         NonNull::new(neighbor)
     }
 
-    /// SAFETY:
+    /// # Safety
+    ///
     /// - `node` must be a valid pointer to a node in an [`RBTree`].
     /// - The caller has immutable access to `node` for the duration of 'b.
     unsafe fn to_key_value<'b>(node: NonNull<bindings::rb_node>) -> (&'b K, &'b V) {
@@ -894,7 +895,8 @@ unsafe fn to_key_value<'b>(node: NonNull<bindings::rb_node>) -> (&'b K, &'b V) {
         (k, unsafe { &*v })
     }
 
-    /// SAFETY:
+    /// # Safety
+    ///
     /// - `node` must be a valid pointer to a node in an [`RBTree`].
     /// - The caller has mutable access to `node` for the duration of 'b.
     unsafe fn to_key_value_mut<'b>(node: NonNull<bindings::rb_node>) -> (&'b K, &'b mut V) {
@@ -904,7 +906,8 @@ unsafe fn to_key_value_mut<'b>(node: NonNull<bindings::rb_node>) -> (&'b K, &'b
         (k, unsafe { &mut *v })
     }
 
-    /// SAFETY:
+    /// # Safety
+    ///
     /// - `node` must be a valid pointer to a node in an [`RBTree`].
     /// - The caller has immutable access to the key for the duration of 'b.
     unsafe fn to_key_value_raw<'b>(node: NonNull<bindings::rb_node>) -> (&'b K, *mut V) {




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux