From patchwork Tue Jan 16 22:06:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Obst X-Patchwork-Id: 188635 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:42cf:b0:101:a8e8:374 with SMTP id q15csp562350dye; Tue, 16 Jan 2024 14:37:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IHgm/i/HYCZxmIkhbCnzvFmsqvdnAgjCivUBYTdfBzEpdOmEjc0aRRE1x8aR59zysOiOxHA X-Received: by 2002:a05:620a:3908:b0:783:2261:dac3 with SMTP id qr8-20020a05620a390800b007832261dac3mr9935223qkn.36.1705444626392; Tue, 16 Jan 2024 14:37:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705444626; cv=pass; d=google.com; s=arc-20160816; b=RIi8WZkp50Bj//VOSKUJ9IqC0UwDlKlq69JgN5jFHCb5Zo95ZQUQ84Dj5uyfQRpIxw juQ7TJ9Y31lZgY5/ZLJbxGCz7gzLAg5Xdc2IOakklO5bh6SOKN7W8HI5eHk3+yhU7Qnh 2cba3+urIpQz8FmUhIDeObeUPjfrJpR5a10m2hsQpeuyUT/UmgefKcSZw5/qUA2Z1KEi IkUobVi0tk0uRLcZQXDhfksggzqKB5Az1OaS3A0K4Ns6K44JAlG0oXPwXVnip/CUcceH /b1PW+8EfKOijnTATtkW572L1t6Sq5F4JFUMxNdVeoe7Tk66cy0wQCjqcJTD9dF1mLvg ySVg== 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=s6ObqvjXKGBn1FKdihATzQPYcjNRgRmmPoX87ciPJuw=; fh=mB5qiQ7ps5IWvjuQS9+zcxjK3ZInVolb8UwIN1mvAmg=; b=y2pdM5sSGiLtyF+U2p3Icr5eFFL+MQemN4oQ1xV4xabhSjxgGnMhLR1pWvHb4sPNs8 ps1uQlyrc3qXqYqS2hpwILvMFqIvPknQ89o886toTZvr9hXh6ZOvhMZbMkI4kMsztrHG Mv7SXLE32IwIBD/TTSVTJUxbwn1zh8IRqOJwh4aDA4gvb0sb4yaYmVML5Na6ejMc2bzT cy/HAmA789d68RAOGKiJoJl71/YnCJjTM4wZjzfv4UAR34TKrIeey8IZ2fo9z2kXHow7 fZDXRKqGutpCjgeBPDK/QIoGU0TTSGe4U6CPYtdfYouaowheWhJ2zmotKKjy7IQwxCDC XNrg== 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-28333-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28333-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j5-20020a05620a146500b007833d053697si10539225qkl.658.2024.01.16.14.37.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 14:37:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28333-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=valentinobst.de); spf=pass (google.com: domain of linux-kernel+bounces-28333-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28333-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 33A141C23D82 for ; Tue, 16 Jan 2024 22:37:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A2DB604CA; Tue, 16 Jan 2024 22:07:02 +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 A277C50257; Tue, 16 Jan 2024 22:06:58 +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=1705442820; cv=none; b=Pa2pDR8DIZwPkdeQRtUqNpoCYQEkbN0WZH43+rWD2r7K11ktUNCIvDcABHxokwNjJZSN8uI2qVrc8HSp2GIDbBFK2cSY69FJciwS4yaGgZRqVe5GzLn+ia2Q9TsZTnIsparGPWaXCkwWXs9+WJlEBylVBuIiQC4O3rsjyj5vJmw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705442820; c=relaxed/simple; bh=j6+7rgEBCA/c/X5mKHo3VbMlssDcyBdbuCJWJNRxt8Y=; h=Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:X-Provags-ID: X-Spam-Flag:UI-OutboundReport; b=XBc9f+D7lub7wMlqyrAllmU6s/1UEOYCQRR7ozyQu0EG3KYHSoHFS7NFzgrOmBLEtOtSVQHa2bscmiOTC5KFZJDqO72hg91Rku1TZo1pgOjxME8Qpkx0vdLYXVvz5X7vL/T5HO3YL4VjtdzAEbfAAiZ61p10sjB7qhZBeMPLFM8= 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 ([217.245.156.100]) by mrelayeu.kundenserver.de (mreue009 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MaIvV-1rc6xa1LD3-00WIzb; Tue, 16 Jan 2024 23:06:43 +0100 From: Valentin Obst To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho Cc: Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Valentin Obst Subject: [PATCH 07/13] rust: kernel: unify spelling of refcount in docs Date: Tue, 16 Jan 2024 23:06:34 +0100 Message-ID: <20240116220634.168103-1-kernel@valentinobst.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240116160141.165951-1-kernel@valentinobst.de> References: <20240116160141.165951-1-kernel@valentinobst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:LZw9oJjc57o5/lxghWGfTXEHpI9wO52N1Q7vBXUMuSrIikpUuFA /wRPeTCC2FC5I/fWxcg7HujN9BJ+9cfiyDvjerjofCYWK++qkNsZyn95dq7U3woXNxmTGEO I9HM7AYgD+VwsB3weGkdVoiOaZj99wNY/JsAqO3Wb5AmsQIsuznp679kqB5sOzqosRwkfmb X12P/4799wzyUNlPKdcGA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:B7paRzsauwk=;7Zg8OGMbyonRRdQLeSvE8EbvRuH DeuAgOrBxtUqEl++ypVX6kVQ42yPvKWxVh3lkhsKTLG4+5vxbEnD0htObVnBgt36h8eVG3byo n2TadqXG+CErGNXT0FtGoJ9RBDmoWvmcUvLxx5k8vcbhkQA8IsM3pTqDkNoor/LoTQqLVI/lu EJWbunYfwA6XLGkvfgR2KD7V9vz+KCD96d7XzvL6Xg3nOHlcpO0uX9M8oXMzz8xOitzFu3Aro Qw8yMkMjVpkQ9QrGeOoa2FhbJEl+db7cqc7DvoXmg0n/rpo3Y6ktWsKpOwnLh+zCZ2AagYH62 LqMEjwilo5mugSIspBAKutImXdlEJDrD3zYn4xdlpaf0JPsxNghUh5I/NdFRQMOb9b/6ImMXj FuZELfBjJrBxB6OakEpfZa7jO83kWJiVKUyWutSybzCPJKxtErGUvhzIsrVug/0A3tkKtkyJy qwMMLd15SBoskdXmlKgs2KySrFANzkr5IUsb8wgW6jZRBzrgpiszzN2MzhVGMJ6HlKeTV4/YH kklnuK+2JB3Uz4b+FQL+1RwWL0y+4NuFSMlmeRaFRiPqc90CeBXh6ZYWl3fXQNCckdv9VsVfA vTZRaQeJUxoqEffd3LJUG/vZTGlSMXOHy9EtQPpqLu5YKSJTp31hMqoc0AsVWUPfuM+YzrIp9 hNq4uIQliNqQ8SoOaHht2ZhgMbps9P9PTIDsU2dRUtDPw79H9qUxyNcP+EG0P37+7mDUxAkVv unIzN7nSuTm+LXfMClaBN/tY6CCUAFrRxD7QwClEPJ3c8p386XurE6YxeRqWuY8uLwTzxNsYr OX2jpxIiz9Wbw2cqQjlLNmHBqLVvskIoxZ9bh4zLCa4c3Lx2mP9+r+r8Es7vsUMSM5ZfqoOB0 Qrywc77cH789l9Q== X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788288304315660298 X-GMAIL-MSGID: 1788288304315660298 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 --- 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.