Skip to content

Commit 9d29c25

Browse files
Valentin Obstojeda
authored andcommitted
rust: kernel: unify spelling of refcount in docs
Replace instances of 'ref-count[ed]' with 'refcount[ed]' to increase consistency within the Rust documentation. The latter form is used more widely in the rest of the kernel: ```console $ rg '(\*|//).*?\srefcount(|ed)[\s,.]' | wc -l 1605 $ rg '(\*|//).*?\sref-count(|ed)[\s,.]' | wc -l 43 ``` (numbers are for commit 052d534 ("Merge tag 'exfat-for-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat")) Signed-off-by: Valentin Obst <kernel@valentinobst.de> Reviewed-by: Trevor Gross <tmgross@umich.edu> Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20240131-doc-fixes-v3-v3-7-0c8af94ed7de@valentinobst.de [ Reworded to use the kernel's commit description style. ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent baa6943 commit 9d29c25

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

rust/kernel/sync/arc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ mod std_vendor;
5656
/// b: u32,
5757
/// }
5858
///
59-
/// // Create a ref-counted instance of `Example`.
59+
/// // Create a refcounted instance of `Example`.
6060
/// let obj = Arc::try_new(Example { a: 10, b: 20 })?;
6161
///
6262
/// // Get a new pointer to `obj` and increment the refcount.
@@ -510,7 +510,7 @@ impl<T: ?Sized> Deref for ArcBorrow<'_, T> {
510510
/// # test().unwrap();
511511
/// ```
512512
///
513-
/// In the following example we first allocate memory for a ref-counted `Example` but we don't
513+
/// In the following example we first allocate memory for a refcounted `Example` but we don't
514514
/// initialise it on allocation. We do initialise it later with a call to [`UniqueArc::write`],
515515
/// followed by a conversion to `Arc<Example>`. This is particularly useful when allocation happens
516516
/// in one context (e.g., sleepable) and initialisation in another (e.g., atomic):
@@ -560,7 +560,7 @@ impl<T> UniqueArc<T> {
560560
/// Tries to allocate a new [`UniqueArc`] instance.
561561
pub fn try_new(value: T) -> Result<Self, AllocError> {
562562
Ok(Self {
563-
// INVARIANT: The newly-created object has a ref-count of 1.
563+
// INVARIANT: The newly-created object has a refcount of 1.
564564
inner: Arc::try_new(value)?,
565565
})
566566
}
@@ -574,7 +574,7 @@ impl<T> UniqueArc<T> {
574574
data <- init::uninit::<T, AllocError>(),
575575
}? AllocError))?;
576576
Ok(UniqueArc {
577-
// INVARIANT: The newly-created object has a ref-count of 1.
577+
// INVARIANT: The newly-created object has a refcount of 1.
578578
// SAFETY: The pointer from the `Box` is valid.
579579
inner: unsafe { Arc::from_inner(Box::leak(inner).into()) },
580580
})

rust/kernel/task.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ macro_rules! current {
3939
///
4040
/// All instances are valid tasks created by the C portion of the kernel.
4141
///
42-
/// Instances of this type are always ref-counted, that is, a call to `get_task_struct` ensures
42+
/// Instances of this type are always refcounted, that is, a call to `get_task_struct` ensures
4343
/// that the allocation remains valid at least until the matching call to `put_task_struct`.
4444
///
4545
/// # Examples
@@ -163,7 +163,7 @@ impl Task {
163163
}
164164
}
165165

166-
// SAFETY: The type invariants guarantee that `Task` is always ref-counted.
166+
// SAFETY: The type invariants guarantee that `Task` is always refcounted.
167167
unsafe impl crate::types::AlwaysRefCounted for Task {
168168
fn inc_ref(&self) {
169169
// SAFETY: The existence of a shared reference means that the refcount is nonzero.

0 commit comments

Comments
 (0)