[13/13] rust: locked_by: shorten doclink preview

Message ID 20240117001613.169177-1-kernel@valentinobst.de
State New
Headers
Series rust: kernel: documentation improvements |

Commit Message

Valentin Obst Jan. 17, 2024, 12:16 a.m. UTC
  Increases readability by removing `super::` from the link preview
text.

Signed-off-by: Valentin Obst <kernel@valentinobst.de>
---
 rust/kernel/sync/locked_by.rs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

Trevor Gross Jan. 18, 2024, 1:18 a.m. UTC | #1
On Tue, Jan 16, 2024 at 7:17 PM Valentin Obst <kernel@valentinobst.de> wrote:
>
> Increases readability by removing `super::` from the link preview
> text.
>
> Signed-off-by: Valentin Obst <kernel@valentinobst.de>
> ---
>  rust/kernel/sync/locked_by.rs | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/rust/kernel/sync/locked_by.rs b/rust/kernel/sync/locked_by.rs
> index b17ee5cd98f3..22c38993bf63 100644
> --- a/rust/kernel/sync/locked_by.rs
> +++ b/rust/kernel/sync/locked_by.rs
> @@ -9,7 +9,7 @@
>  /// Allows access to some data to be serialised by a lock that does not wrap it.
>  ///
>  /// In most cases, data protected by a lock is wrapped by the appropriate lock type, e.g.,
> -/// [`super::Mutex`] or [`super::SpinLock`]. [`LockedBy`] is meant for cases when this is not
> +/// [`Mutex`] or [`SpinLock`]. [`LockedBy`] is meant for cases when this is not
>  /// possible. For example, if a container has a lock and some data in the contained elements needs
>  /// to be protected by the same lock.
>  ///
> @@ -17,6 +17,9 @@
>  /// when the caller shows evidence that the 'external' lock is locked. It panics if the evidence
>  /// refers to the wrong instance of the lock.
>  ///
> +/// [`Mutex`]: super::Mutex
> +/// [`SpinLock`]: super::SpinLock
> +///
>  /// # Examples
>  ///
>  /// The following is an example for illustrative purposes: `InnerDirectory::bytes_used` is an
> --
> 2.43.0
>
>

Reviewed-by: Trevor Gross <tmgross@umich.edu>
  
Alice Ryhl Jan. 30, 2024, 9:18 a.m. UTC | #2
On Wed, Jan 17, 2024 at 1:16 AM Valentin Obst <kernel@valentinobst.de> wrote:
>  /// In most cases, data protected by a lock is wrapped by the appropriate lock type, e.g.,
> -/// [`super::Mutex`] or [`super::SpinLock`]. [`LockedBy`] is meant for cases when this is not
> +/// [`Mutex`] or [`SpinLock`]. [`LockedBy`] is meant for cases when this is not
>  /// possible. For example, if a container has a lock and some data in the contained elements needs
>  /// to be protected by the same lock.

It looks like the text should be reflowed here. The "possible" word
fits on the previous line.
  

Patch

diff --git a/rust/kernel/sync/locked_by.rs b/rust/kernel/sync/locked_by.rs
index b17ee5cd98f3..22c38993bf63 100644
--- a/rust/kernel/sync/locked_by.rs
+++ b/rust/kernel/sync/locked_by.rs
@@ -9,7 +9,7 @@ 
 /// Allows access to some data to be serialised by a lock that does not wrap it.
 ///
 /// In most cases, data protected by a lock is wrapped by the appropriate lock type, e.g.,
-/// [`super::Mutex`] or [`super::SpinLock`]. [`LockedBy`] is meant for cases when this is not
+/// [`Mutex`] or [`SpinLock`]. [`LockedBy`] is meant for cases when this is not
 /// possible. For example, if a container has a lock and some data in the contained elements needs
 /// to be protected by the same lock.
 ///
@@ -17,6 +17,9 @@ 
 /// when the caller shows evidence that the 'external' lock is locked. It panics if the evidence
 /// refers to the wrong instance of the lock.
 ///
+/// [`Mutex`]: super::Mutex
+/// [`SpinLock`]: super::SpinLock
+///
 /// # Examples
 ///
 /// The following is an example for illustrative purposes: `InnerDirectory::bytes_used` is an