Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp573248rdb; Tue, 23 Jan 2024 08:08:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQi4uyCspV9KEzVVrs8ltUU842Pb1Vtktx96JzwBZyCuiev0ONDIR5dwQ9onb4ZaWv6kw1 X-Received: by 2002:a17:906:9ac2:b0:a2e:b3d1:a1d4 with SMTP id ah2-20020a1709069ac200b00a2eb3d1a1d4mr42530ejc.111.1706026107987; Tue, 23 Jan 2024 08:08:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706026107; cv=pass; d=google.com; s=arc-20160816; b=KvgP9m2RoXyLSdXbJRtu5CTF/5GojoIjlDsMq2EaAbK0eJ2XVpctAT7mpDIziwnECD jmFLO4Frm0VLNDQOOJVH9YWIuC/jiF14HOl8/NadWgEO4KwnY/ouj9oMOWtr69SNTQ0e gzUgi1mQQP/slinv1vdaruyDI0CcR9mhKQzJ0zwhe/Q4+p6qfcEZnWhSwNBXLv+/PNjB 6BEfizMVxuFXAsrOUt9ziS6/rrSb/JHRZrdE5Ua6tMIAfN0scLvwRX+25dZrDUKqOk0b F2VyglghzQX9xuQ11z/jkGU8PkayX/C3aqap74bRw/28SXBtPJjPEhpfl5ckiDCJ9BFn HgWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from; bh=9S7K5KQu8M1nvgkInN/G/1oA/haJK9eC/Scj28KnLUA=; fh=BZI9iWTaEf0O3fXVlcMygnOLgsZaFpsfuA9TcLqdYG4=; b=AxpzATv1q/7p7zkCJSJSo3+ykb9mGH4ayFRLWxLEN/+73z5xR/pJGMxLlGA8aN2TQ9 GUgeSb2p3aM1Ns+BB0NLxTOWEfkFE73OJKH8nvlx2TlaOw2NUCWPLfKp84XrUkPVrkqG Hlk77BK4A5VAliwyi8iuhDwWi6F1fuO2BbdsWla0ZB447+lzzlnb/4QVm7bgOOCduPHy L/7NnouWTndWmTQ9Gyljx4ggujpz0sCOqFISCGD5wJ8moEEGRzKRUOT7TVd0cgc2LieW SV2zf2dugINEfjhZVKalnmH79Z4uxSSZUofkoo3c+d5Pr8dW7XLJB/3kh7urbluhsbJu ApLQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=valentinobst.de); spf=pass (google.com: domain of linux-kernel+bounces-35623-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35623-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c11-20020a170906d18b00b00a2c178aa19bsi11880833ejz.771.2024.01.23.08.08.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 08:08:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35623-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=valentinobst.de); spf=pass (google.com: domain of linux-kernel+bounces-35623-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35623-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A11BE1F2603C for ; Tue, 23 Jan 2024 16:08:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A79061674; Tue, 23 Jan 2024 16:08:08 +0000 (UTC) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AAC22612F0; Tue, 23 Jan 2024 16:08:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.126.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706026087; cv=none; b=YdmIXQQZWk/qN7Cku+oPyMSd1JCC9wl0eHrl/tnMZhs27Csk9RQjgbZ9ttWS98fyAlbytF1mrQxbFTnWCuMjPdKH9oy9siftOJPL5+h0p97gJ1ejdcccCJp7AHIN9ICuKzSXYwDkLYtj4/SfNvAU80wKO0uHPQOEsQaiebVv+Lg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706026087; c=relaxed/simple; bh=dcjqT6LwDiJet5DL11/RabzBcNLvOWMbGrooPlheAbU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MruHhD4GgquAfw8qz0mTKwdVOcvGqhrR54JaeVQDJkWsQekYLl17Eurhzki5Do4WKgs44yWStUPvtuM+djhBl0V0szstZRYwCnt9izvlsiwi9cWs8VcXUcvVpau3j7zSErVIEm19TL1/fL1WQ649mAd2bFwnDPCnh2I6/EYwgFY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=valentinobst.de; spf=pass smtp.mailfrom=valentinobst.de; arc=none smtp.client-ip=212.227.126.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=valentinobst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=valentinobst.de Received: from localhost.localdomain ([95.223.130.98]) by mrelayeu.kundenserver.de (mreue011 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MLRDv-1rj1DV3Ck7-00IRcC; Tue, 23 Jan 2024 17:07:46 +0100 From: Valentin Obst To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 07/12] rust: kernel: unify spelling of refcount in docs Date: Tue, 23 Jan 2024 17:07:46 +0100 Message-ID: <20240123160746.125310-1-kernel@valentinobst.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240123150112.124084-1-kernel@valentinobst.de> References: <20240123150112.124084-1-kernel@valentinobst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:oz7nBXnl6WKtzIifeIQQp/y21tgQTbcqFqguCS0tl9mId5WT3FO x0bHGtitmGuCGA52GfmAok6Uv0oxPEhw4nwzkpYcQXosTUi/ce0AFZHxruVeUfwGoECgddW tpuZUIZsjfY5/0IgMODQXzjWHWY1S7gGoG7cQbpu7JcKm14+o1+xCuJdIvSnidY8p7WIWcY i74nOrBvOfe1nXKdxqByw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:cqVRWdgTbnM=;Cv2PKUFiZOF7VUI4CrEaqm5CXBG jrhytFZRysztOUiuiX7xEe3B08xilN/ZdVlJqdsOCvn2w9qxicfXhwcpOwu1e1w2kPci3DDYw Xlz8jSxQTFC0Hb2Ro96ojSKVanOKBIJcbsmNCxfO6fY/QccEOOmqWytO2vcPIXGGJkttB+gp5 Y3FT/N9RfcXoUw/S0/KA3DGL3kPVXT3HRMe0ji3bI8f6YezI9r/LnxFs2GMEdGVD+b9mJYUI2 1+l10wx374HQlFlOK7eU2uhVWQAISQ6E1VObAVbuiCr4gVKZhcNLgvD7Ml8M+NyCt3MtqcvaY i3a7+4gEBIiyaH7Oj5yUJ07v0zgpHMNmEigQEkCgK4WyRULVC9va+bsWG+zFDm9jFg975eQif 7XmeutsgG2t6lPAy5TlYAeg+SdUokA66H7oFwzW54vmeDgujEI8jC+VUVFGBDyHJR6BmcqL/3 cd5+zshZByTo0JIByCNb05G4sCxdoRDTnQWJ28DVuIY+7354HSm3GmFiHylsCbU3624At+2Ks oRG2Hu9zucXK651K6wb83laVvN3a3Cl5ozJ1W6mBF0yG+38noSKTmqM+DVCZSzPWF9tLFzinQ HRij5k3zZu5mr8yborq3Ka/A9rjJGCwfTgRERm8pBgInG4lpNnY86FNkQCjHDDCxo8A6ZIe7E q6i+f/utTyYd8sWaN7GBVU+bJWfRFya8vqGxrcwE1CtTqnX/O550WGYctOTHrMdDyBz4QLYiW ZlzaJEafG4DiiuCBa6j/67oHBoGcfz90pu+8WPWkiF+ydlPL7IEG67yWB/8tlyeVtFYH5qZuy BBsgr5GV2Xbi0/wkoF5ns69L5Cqx/tqVGoH9EkQ6Twdee8Gqs6VTF5cDFcuNlpRZXEB/I3v5i xPVkcuTc0db9LTQ== 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 052d534373b7) Signed-off-by: Valentin Obst Reviewed-by: Trevor Gross Reviewed-by: Martin Rodriguez Reboredo --- rust/kernel/sync/arc.rs | 8 ++++---- rust/kernel/task.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rust/kernel/sync/arc.rs b/rust/kernel/sync/arc.rs index 77cdbcf7bd2e..6c46b1affca5 100644 --- a/rust/kernel/sync/arc.rs +++ b/rust/kernel/sync/arc.rs @@ -56,7 +56,7 @@ /// b: u32, /// } /// -/// // Create a ref-counted instance of `Example`. +/// // Create a refcounted instance of `Example`. /// let obj = Arc::try_new(Example { a: 10, b: 20 })?; /// /// // Get a new pointer to `obj` and increment the refcount. @@ -510,7 +510,7 @@ fn deref(&self) -> &Self::Target { /// # test().unwrap(); /// ``` /// -/// In the following example we first allocate memory for a ref-counted `Example` but we don't +/// In the following example we first allocate memory for a refcounted `Example` but we don't /// initialise it on allocation. We do initialise it later with a call to [`UniqueArc::write`], /// followed by a conversion to `Arc`. This is particularly useful when allocation happens /// in one context (e.g., sleepable) and initialisation in another (e.g., atomic): @@ -560,7 +560,7 @@ impl UniqueArc { /// Tries to allocate a new [`UniqueArc`] instance. pub fn try_new(value: T) -> Result { Ok(Self { - // INVARIANT: The newly-created object has a ref-count of 1. + // INVARIANT: The newly-created object has a refcount of 1. inner: Arc::try_new(value)?, }) } @@ -574,7 +574,7 @@ pub fn try_new_uninit() -> Result>, AllocError> { data <- init::uninit::(), }? AllocError))?; Ok(UniqueArc { - // INVARIANT: The newly-created object has a ref-count of 1. + // INVARIANT: The newly-created object has a refcount of 1. // SAFETY: The pointer from the `Box` is valid. inner: unsafe { Arc::from_inner(Box::leak(inner).into()) }, }) diff --git a/rust/kernel/task.rs b/rust/kernel/task.rs index 9451932d5d86..818ac51b06b6 100644 --- a/rust/kernel/task.rs +++ b/rust/kernel/task.rs @@ -23,7 +23,7 @@ macro_rules! current { /// /// All instances are valid tasks created by the C portion of the kernel. /// -/// Instances of this type are always ref-counted, that is, a call to `get_task_struct` ensures +/// Instances of this type are always refcounted, that is, a call to `get_task_struct` ensures /// that the allocation remains valid at least until the matching call to `put_task_struct`. /// /// # Examples @@ -147,7 +147,7 @@ pub fn wake_up(&self) { } } -// SAFETY: The type invariants guarantee that `Task` is always ref-counted. +// SAFETY: The type invariants guarantee that `Task` is always refcounted. unsafe impl crate::types::AlwaysRefCounted for Task { fn inc_ref(&self) { // SAFETY: The existence of a shared reference means that the refcount is nonzero. -- 2.43.0