From patchwork Wed Jan 31 20:23:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Obst via B4 Relay X-Patchwork-Id: 194923 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp3613dyc; Wed, 31 Jan 2024 12:27:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyaCqSAazJ/+JvWuje/6wl7ndsNKYOJpuJDGvEeLgifuCoud9jAvic+4Qfip9lqk/9QilQ X-Received: by 2002:a05:6402:2689:b0:55f:a84b:c3cb with SMTP id w9-20020a056402268900b0055fa84bc3cbmr472948edd.30.1706732829738; Wed, 31 Jan 2024 12:27:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706732829; cv=pass; d=google.com; s=arc-20160816; b=i60uQEygyQw5J/PeZRPpqJB6iXPTYfMRuXnss0yd6DVKFLNXZgx0l6qmi2dJgxRxzo VQE9XntYIY0a0EyIWnAtTzm7vSSDh8vz296tfw+794uwbO7yMlQZJ4zamPFr9mM93oqQ MMO+4Nlmwh8l/j7lLrCrC8wyKmuFeAXlJWuMK7wZmXsmYpm8DUAPF00QA/WfEU0D50Bu DRZkd0vhdxerhWSJ7HI20ICv0PaABLECzgOEZJ4/L49mDMMv0NKCBBmSeouUYpjc9rN4 gAvlEl680DYHI/FiD3RxfnFnDhgL/7q8JLpEs55FlfKrqeRvqP2+MC+zouVfvDtNK4sN vCVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=Pa26Zx1fmpxJ4E+zao8wxCUxhFIqKFzfFcO9og+1mc4=; fh=BnHVvq1CKb+rACxLmz8aHEDACS7k9seS5je+oizfOhg=; b=VR1jBoP+hSwuYPJv1aQlDif+48OY2WfoBqOlhytp48Vbpkv6E5wzxRKj0i9BK/j3Cc 8GNjaJHo8NCprJGxcr47++QUvZiGpXOajYqoo1NEw1JbmkXEqgWm/Gj+Z2HCTZvb0JJK Kdp9Z6GMTopxZjHRQvdZxoHUiW6TMusoJV4V520nY0nYpPSzljuQ+fjQeaz5igTxSvWI ehoUHe83QeTHYDrmiriq5gNUv+AHyEwZpfRud8bE+R7e4xSy+y15vv8mfMnIMZ4TiKg9 V/kuW8ozFpMZg6ty+SvBVZ0u5LfD7zsq8arg+r4tLaF31v0WwZUW+LtMkvfvvMZ3czVz UGPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E9cafvoJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47064-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47064-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCUTCWoZECrCuwmrP02VnrgUywQXEdWuN/I3WqjEWqUfD8OmetfA6O2tJyyFkwjGP9oDqIpI7/NrvxZf7oBaTAeTB3a4cg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id er20-20020a056402449400b0055ee0391aa0si4177733edb.597.2024.01.31.12.27.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 12:27:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47064-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E9cafvoJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47064-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47064-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 151531F24E31 for ; Wed, 31 Jan 2024 20:27:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B3AC213D50D; Wed, 31 Jan 2024 20:24:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="E9cafvoJ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3A05F405FB; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; cv=none; b=ew3iRqkGfJ/yQciF6lCbBmKhcVpTflfXFBrk/HBOs1gREH1DyR76QFu+nv9iAsK6c4XQZ59Fe+jqWAr3JIop9fvlA+njTMHB2qTqhK+2R1pz4dVkyvRjFQOsu9fdQuzkfIw+R0xNcFH7Ob/uypaQLNWEtSxk8r+dr6eb5EOwI00= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; c=relaxed/simple; bh=PvtMQBD1nzrPCWrpIxzcWBmhKwGTdsFy2wiCmXx5kmc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lPwc6WusXyv2p/I5jOlNKUqh0HSAhOZdhpYvLGfwU166XUKRPfl+KAjZTx2CWJfVwwaMTzRv2zY+nYC01LzCMxvFPwh3DLhKiTV6aY421MFKkycR7qeTHvBykvWIwpc2s/xdOvi/lsNsg1u26lsfPJvNGxmcF/iPZttjOf0wEaI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E9cafvoJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id C9CA3C433F1; Wed, 31 Jan 2024 20:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706732648; bh=PvtMQBD1nzrPCWrpIxzcWBmhKwGTdsFy2wiCmXx5kmc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=E9cafvoJF0JXHvi2eNyiaSY200M0Sp2uhQ6moobZxgZIjUMiRkrIpMn3EklDCBkVz /oIxVpNmHtkN6tJN+Fyi/EHsog/L84nodmF0iSPKHv/e2ckJjdwqRkLBw00wufN0GD Q64tgfMLD0PWebgApJ+Tcc1dLRQryrSrcgKG3i+IRQJdffhZUclT6Bcp3VKNCKX77A w2XJAIwOZDbToOWpoy6rlJecx9n+wdrwqFals+z+L/Uv6iQs54QBE9gh1woRoaKBVp rSWVrVqy0JsCtNG29HZplN+l38g9Wg3awXle6MhT3GRtECKbZ8IeHpV9q9lE60/wBf OyYgS9ihbswQw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD84DC48285; Wed, 31 Jan 2024 20:24:08 +0000 (UTC) From: Valentin Obst via B4 Relay Date: Wed, 31 Jan 2024 21:23:23 +0100 Subject: [PATCH v3 01/12] rust: kernel: fix multiple typos in documentation Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240131-doc-fixes-v3-v3-1-0c8af94ed7de@valentinobst.de> References: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> In-Reply-To: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Valentin Obst , Trevor Gross , Martin Rodriguez Reboredo X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706732646; l=9277; i=kernel@valentinobst.de; s=20240131; h=from:subject:message-id; bh=jWhzEv3VcHW57738U5ZKKHmNbKt/A7SeH+hRAr2L2Bk=; b=QY87KrykNPYCphGyXkSBtlMng+/CCeRX5yyJaO90ypoGHxmiwefLYtHxVSaqdkgiFiTZD+q++ /2luZABdQmlD6bDQWk6mh/755foHs+alRCJwsiaKZLzatLel2fdGOeH X-Developer-Key: i=kernel@valentinobst.de; a=ed25519; pk=3s7U8y0mqkaiurgHSQQTYWOo2tw5HgzCg5vnJVfw37Y= X-Endpoint-Received: by B4 Relay for kernel@valentinobst.de/20240131 with auth_id=124 X-Original-From: Valentin Obst Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789639084075729771 X-GMAIL-MSGID: 1789639084075729771 From: Valentin Obst Fixes multiple trivial typos in documentation and comments of the kernel crate. allocator: - Fix a trivial list item alignment issue in the last SAFETY comment of `krealloc_aligned`. init: - Replace 'type' with 'trait' in the doc comments of the `PinInit` and `Init` traits. - Add colons before starting lists. - Add spaces between the type and equal sign to respect the code formatting rules in example code. - End a sentence with a full stop instead of a colon. ioctl: - Replace 'an' with 'a' where appropriate. str: - Replace 'Return' with 'Returns' in the doc comment of `bytes_written` as the text describes what the function does. sync/lock: - Fix a trivial list item alignment issue in the Safety section of the `Backend` trait's description. sync/lock/spinlock: - The code in this module operates on spinlocks, not mutexes. Thus, replace 'mutex' with 'spinlock' in the SAFETY comment of `unlock`. workqueue: - Replace "wont" with "won't" in the doc comment of `__enqueue`. Signed-off-by: Valentin Obst Reviewed-by: Trevor Gross Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Alice Ryhl --- rust/kernel/allocator.rs | 2 +- rust/kernel/init.rs | 16 ++++++++-------- rust/kernel/ioctl.rs | 4 ++-- rust/kernel/str.rs | 2 +- rust/kernel/sync/lock.rs | 4 ++-- rust/kernel/sync/lock/spinlock.rs | 2 +- rust/kernel/workqueue.rs | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/rust/kernel/allocator.rs b/rust/kernel/allocator.rs index 4b057e837358..01ad139e19bc 100644 --- a/rust/kernel/allocator.rs +++ b/rust/kernel/allocator.rs @@ -35,7 +35,7 @@ unsafe fn krealloc_aligned(ptr: *mut u8, new_layout: Layout, flags: bindings::gf // - `ptr` is either null or a pointer returned from a previous `k{re}alloc()` by the // function safety requirement. // - `size` is greater than 0 since it's either a `layout.size()` (which cannot be zero - // according to the function safety requirement) or a result from `next_power_of_two()`. + // according to the function safety requirement) or a result from `next_power_of_two()`. unsafe { bindings::krealloc(ptr as *const core::ffi::c_void, size, flags) as *mut u8 } } diff --git a/rust/kernel/init.rs b/rust/kernel/init.rs index 65be9ae57b80..16a99984622c 100644 --- a/rust/kernel/init.rs +++ b/rust/kernel/init.rs @@ -751,10 +751,10 @@ macro_rules! try_init { /// /// # Safety /// -/// When implementing this type you will need to take great care. Also there are probably very few +/// When implementing this trait you will need to take great care. Also there are probably very few /// cases where a manual implementation is necessary. Use [`pin_init_from_closure`] where possible. /// -/// The [`PinInit::__pinned_init`] function +/// The [`PinInit::__pinned_init`] function: /// - returns `Ok(())` if it initialized every field of `slot`, /// - returns `Err(err)` if it encountered an error and then cleaned `slot`, this means: /// - `slot` can be deallocated without UB occurring, @@ -861,10 +861,10 @@ unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), E> { /// /// # Safety /// -/// When implementing this type you will need to take great care. Also there are probably very few +/// When implementing this trait you will need to take great care. Also there are probably very few /// cases where a manual implementation is necessary. Use [`init_from_closure`] where possible. /// -/// The [`Init::__init`] function +/// The [`Init::__init`] function: /// - returns `Ok(())` if it initialized every field of `slot`, /// - returns `Err(err)` if it encountered an error and then cleaned `slot`, this means: /// - `slot` can be deallocated without UB occurring, @@ -1013,7 +1013,7 @@ pub fn uninit() -> impl Init, E> { /// /// ```rust /// use kernel::{error::Error, init::init_array_from_fn}; -/// let array: Box<[usize; 1_000]>= Box::init::(init_array_from_fn(|i| i)).unwrap(); +/// let array: Box<[usize; 1_000]> = Box::init::(init_array_from_fn(|i| i)).unwrap(); /// assert_eq!(array.len(), 1_000); /// ``` pub fn init_array_from_fn( @@ -1027,7 +1027,7 @@ pub fn init_array_from_fn( // Counts the number of initialized elements and when dropped drops that many elements from // `slot`. let mut init_count = ScopeGuard::new_with_data(0, |i| { - // We now free every element that has been initialized before: + // We now free every element that has been initialized before. // SAFETY: The loop initialized exactly the values from 0..i and since we // return `Err` below, the caller will consider the memory at `slot` as // uninitialized. @@ -1056,7 +1056,7 @@ pub fn init_array_from_fn( /// /// ```rust /// use kernel::{sync::{Arc, Mutex}, init::pin_init_array_from_fn, new_mutex}; -/// let array: Arc<[Mutex; 1_000]>= +/// let array: Arc<[Mutex; 1_000]> = /// Arc::pin_init(pin_init_array_from_fn(|i| new_mutex!(i))).unwrap(); /// assert_eq!(array.len(), 1_000); /// ``` @@ -1071,7 +1071,7 @@ pub fn pin_init_array_from_fn( // Counts the number of initialized elements and when dropped drops that many elements from // `slot`. let mut init_count = ScopeGuard::new_with_data(0, |i| { - // We now free every element that has been initialized before: + // We now free every element that has been initialized before. // SAFETY: The loop initialized exactly the values from 0..i and since we // return `Err` below, the caller will consider the memory at `slot` as // uninitialized. diff --git a/rust/kernel/ioctl.rs b/rust/kernel/ioctl.rs index f1d42ab69972..59050e5f5a5a 100644 --- a/rust/kernel/ioctl.rs +++ b/rust/kernel/ioctl.rs @@ -28,13 +28,13 @@ pub const fn _IO(ty: u32, nr: u32) -> u32 { _IOC(uapi::_IOC_NONE, ty, nr, 0) } -/// Build an ioctl number for an read-only ioctl. +/// Build an ioctl number for a read-only ioctl. #[inline(always)] pub const fn _IOR(ty: u32, nr: u32) -> u32 { _IOC(uapi::_IOC_READ, ty, nr, core::mem::size_of::()) } -/// Build an ioctl number for an write-only ioctl. +/// Build an ioctl number for a write-only ioctl. #[inline(always)] pub const fn _IOW(ty: u32, nr: u32) -> u32 { _IOC(uapi::_IOC_WRITE, ty, nr, core::mem::size_of::()) diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs index 7d848b83add4..0a8569594fc3 100644 --- a/rust/kernel/str.rs +++ b/rust/kernel/str.rs @@ -449,7 +449,7 @@ pub(crate) fn pos(&self) -> *mut u8 { self.pos as _ } - /// Return the number of bytes written to the formatter. + /// Returns the number of bytes written to the formatter. pub(crate) fn bytes_written(&self) -> usize { self.pos - self.beg } diff --git a/rust/kernel/sync/lock.rs b/rust/kernel/sync/lock.rs index 149a5259d431..072b8ef2a0fa 100644 --- a/rust/kernel/sync/lock.rs +++ b/rust/kernel/sync/lock.rs @@ -21,9 +21,9 @@ /// # Safety /// /// - Implementers must ensure that only one thread/CPU may access the protected data once the lock -/// is owned, that is, between calls to `lock` and `unlock`. +/// is owned, that is, between calls to `lock` and `unlock`. /// - Implementers must also ensure that `relock` uses the same locking method as the original -/// lock operation. +/// lock operation. pub unsafe trait Backend { /// The state required by the lock. type State; diff --git a/rust/kernel/sync/lock/spinlock.rs b/rust/kernel/sync/lock/spinlock.rs index 068535ce1b29..e5e0bf621988 100644 --- a/rust/kernel/sync/lock/spinlock.rs +++ b/rust/kernel/sync/lock/spinlock.rs @@ -112,7 +112,7 @@ unsafe fn lock(ptr: *mut Self::State) -> Self::GuardState { unsafe fn unlock(ptr: *mut Self::State, _guard_state: &Self::GuardState) { // SAFETY: The safety requirements of this function ensure that `ptr` is valid and that the - // caller is the owner of the mutex. + // caller is the owner of the spinlock. unsafe { bindings::spin_unlock(ptr) } } } diff --git a/rust/kernel/workqueue.rs b/rust/kernel/workqueue.rs index 498397877376..8775c34d12a5 100644 --- a/rust/kernel/workqueue.rs +++ b/rust/kernel/workqueue.rs @@ -253,7 +253,7 @@ fn run(mut this: Pin>) { /// actual value of the id is not important as long as you use different ids for different fields /// of the same struct. (Fields of different structs need not use different ids.) /// -/// Note that the id is used only to select the right method to call during compilation. It wont be +/// Note that the id is used only to select the right method to call during compilation. It won't be /// part of the final executable. /// /// # Safety From patchwork Wed Jan 31 20:23:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Obst via B4 Relay X-Patchwork-Id: 194922 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp3477dyc; Wed, 31 Jan 2024 12:26:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHy1ebFWTmfnIhl19vSoURLdUoxzUZ0iXWTlGTXBXyID22IGizKw0Kcqwt0fHjzFu5ATbvT X-Received: by 2002:a05:6902:e13:b0:dc2:3f75:1f79 with SMTP id df19-20020a0569020e1300b00dc23f751f79mr3388404ybb.23.1706732814398; Wed, 31 Jan 2024 12:26:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706732814; cv=pass; d=google.com; s=arc-20160816; b=FkwxYnmBu95C+XBj+1rgFCDdmf+/0uA++e5Z9jpWG3QzvUY9nK3XTe3eLgMLU2m5Ee jnHQ16EU690Pg9WEgLYNz0PzzoezYVkwkHcAvp/r2j6Ifk8CN8v6ugpdq4B52YhJ24XC ZFQOFkF7Wbq+g0IoxrVT7168gx/BjA+0JMDbr48PInmbihsveTfix3+mQ0Plu9o6dztk H1vPPlBIAbArnx6yHWgDHrQ0gQJ4Yy04AgPaIbhuyg/2jKo2ScxQd2onz4Y46apjUEsA RovCG7RINLCs4pfUalTZtB61fDCs9nfOyDfMnknloQPtS1EY3hqtUYfHGrmrzvZRqT1f qWug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=NR/AxSO+/VzERySueDZiQaX4+a+3W0mCm0GQSd4ktU0=; fh=hJKxds4AEPT2Gq1zRchx5zE2aaRrWRkm5A5VLQt/2UQ=; b=lbUo9YaUYvCtXAf5mvBqO21Fs7/8HnJL4D5g9Bx13hqGhMpnCEUx685mgs/mhPloDQ itcY5agFVZc5qcbv4FgYqIaPcm/0cAge14CUhqWwrIQWB/GJ0Dd/S2/NOLYLXlDo1gqZ qKrj7yVDyv9/3+bgAb+WrU7GcknpxR2D7Uj1ufP2Bek0RgNU9SbpYDePQCobVtQb3ddm R1R1KHuYafRWPh8Na4acZdPFuW0d+PYZG271bqxU4s6hfTQiUR0w/vd6sTtu28ajnmur c3f93COjZiNlxPLJKWAN+6/D7fhMictWbTWNL+wlkCI9mivVvELQzg25foRubu/ei5vu 8VcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZSYEa0HD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47065-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47065-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCX3mumfQMbzlo7X8HUqBQ3BP9XJ1A9+mITzTQooRxb0BOveMi+WqQqaFUlUGNfaksx9a/Hk6DS/7v9iolRwRQKKQ/w0ig== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b26-20020a05620a127a00b0078437ff3445si3818803qkl.36.2024.01.31.12.26.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 12:26:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47065-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZSYEa0HD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47065-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47065-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 EA71B1C2164D for ; Wed, 31 Jan 2024 20:26:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3148813B7AF; Wed, 31 Jan 2024 20:24:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZSYEa0HD" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3A0A2405FD; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; cv=none; b=P/pXmIc5LuyTgQOzb2sZwva4gIZQg7Cd0ksHCuAISQ0P3/3v6Nj0TlzVy9S/jiLONiuPExPk0c60fM+kBKs0A3B+omJy3/Qtsh2HHSYea/QF21N1XR6cRl5VKMfvPZwn1xAk6HJ1KSCofvAW2gKeNl2+YGkVN98rYYeckiv9yeA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; c=relaxed/simple; bh=7+HfyhzzCkGim8Q92q/WPjGDaBB/DO24UGQTf2LaIQ0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fXAZc8bEKf65Cy/gOnmm2n7ccDl4mqs1t6pL0WVBpepPwM8sj/YtRI9utRB76gmJV/hOdyLE1g/rLGzO5PVF0zvGVPpZA7RtSDEQEv+YSg4SzjGERi901SN0Ej8bAg0vakj9j7AETE3ZbVvJ0naMtKQvOrVhWUoTF9vnthTXmi8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZSYEa0HD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id D1C33C43394; Wed, 31 Jan 2024 20:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706732648; bh=7+HfyhzzCkGim8Q92q/WPjGDaBB/DO24UGQTf2LaIQ0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ZSYEa0HDHmlAX4RfR0TPN42+rM0RHSUisBaQruyPofDeVyY46LsD0wbAzS1oc05Hi 8srel8f/3fpc7p+c1S21+O0XLhH0kOyBK9tEdY3eUxAepvrkluZ7PVslwHHxp5xt7E o3Us+TH8H7cwIgNke7oi3Fx87Oe35g3Bt5/06EhmOCjDpQO5YOJ2YvrmfG4e+Au7Vm /ac33OaEtoBMOq1oInW4SeOUwAU494ZlbNS4K2T86pggZ9dTAk+fSfQ1PAQ/bTbF8q KIxQMu3ITLNddY8fmC99vBEtO5sEbVTKMWTOaYrd6iaU9gOMZkpMLaYOXlG2f7W/h6 yIF5U0evb/NfQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8159C47DB3; Wed, 31 Jan 2024 20:24:08 +0000 (UTC) From: Valentin Obst via B4 Relay Date: Wed, 31 Jan 2024 21:23:24 +0100 Subject: [PATCH v3 02/12] rust: error: improve unsafe code in example Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240131-doc-fixes-v3-v3-2-0c8af94ed7de@valentinobst.de> References: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> In-Reply-To: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Valentin Obst , Martin Rodriguez Reboredo X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706732646; l=1327; i=kernel@valentinobst.de; s=20240131; h=from:subject:message-id; bh=6+MgMwYSzO387ZH/l2u1ebga1PIh0bS6tqLpjrjT2uo=; b=Z/KZuTuucZxrwSZ2hrvH8wBevQGTrKv8ViFSulOXQ1vFBR+NAq8VtP/cKqkH5mqutwRli950E awsD2FxX7uKDb2cDfX6wfRCyUn4Pjr4siGeIBadFu//Jic/rXph6dUM X-Developer-Key: i=kernel@valentinobst.de; a=ed25519; pk=3s7U8y0mqkaiurgHSQQTYWOo2tw5HgzCg5vnJVfw37Y= X-Endpoint-Received: by B4 Relay for kernel@valentinobst.de/20240131 with auth_id=124 X-Original-From: Valentin Obst Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789639067555451428 X-GMAIL-MSGID: 1789639067555451428 From: Valentin Obst The `from_err_ptr` function is safe. There is no need for the call to it to be inside the unsafe block. Reword the SAFETY comment to provide a better justification of why the FFI call is safe. Signed-off-by: Valentin Obst Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Alice Ryhl Reviewed-by: Trevor Gross --- rust/kernel/error.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs index 4f0c1edd63b7..4786d3ee1e92 100644 --- a/rust/kernel/error.rs +++ b/rust/kernel/error.rs @@ -264,13 +264,9 @@ pub fn to_result(err: core::ffi::c_int) -> Result { /// pdev: &mut PlatformDevice, /// index: u32, /// ) -> Result<*mut core::ffi::c_void> { -/// // SAFETY: FFI call. -/// unsafe { -/// from_err_ptr(bindings::devm_platform_ioremap_resource( -/// pdev.to_ptr(), -/// index, -/// )) -/// } +/// // SAFETY: `pdev` points to a valid platform device. There are no safety requirements +/// // on `index`. +/// from_err_ptr(unsafe { bindings::devm_platform_ioremap_resource(pdev.to_ptr(), index) }) /// } /// ``` // TODO: Remove `dead_code` marker once an in-kernel client is available. From patchwork Wed Jan 31 20:23:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Obst via B4 Relay X-Patchwork-Id: 194920 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp3191dyc; Wed, 31 Jan 2024 12:26:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IEvioJ8wAyxaQTh4xzP9g88mQBILSgTT8d9xVMijzY59tEM1TKjm4ccPy/vPRw/oDSWIARj X-Received: by 2002:a05:6a20:65a6:b0:19e:3093:9b89 with SMTP id p38-20020a056a2065a600b0019e30939b89mr2646933pzh.25.1706732776231; Wed, 31 Jan 2024 12:26:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706732776; cv=pass; d=google.com; s=arc-20160816; b=oZvkWmsQbG04ESP5E0l/QOhW8rESxtCSZMiSHeBWDE7SaC2YOmMr0bKWqAy95grOXK XYde9npk8Lf8+69Eye+xKSqKSmIMzedt83Ghro6/pg3OrKxuVRPXXz9dPoACt65y7tdQ vDEmty7inU43Hzj46/hdrcfCsGDDiCs5fsgJM2oRQcXqzf5KP3lEcul0vmdbc+zrOte1 cDEXCW0++4LIyMadlADpLMbgHwqLoUiHekUk+K+4+tgkR6/y+md8RjqXezQFfVb5fvl5 5xxWqUK8YweBNyAWUk127X558iPOM5MLdxVgYrZJQMfrMBgp4f8lf1f/5qpzWGDiILF7 Dbfw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=3JUolfs9Q6Ey5Dwf46cAuxEV+c9PcN9nLgNg7XICiN8=; fh=9AZJM61axZ3B6GR5Is671ghgkK6YbsEL1ryQ8MHSs4Y=; b=oNmsk1apsUqHL2+lGGWfN7rqFtB62EUwN59tkFGsxBYCjZ3fD2XeUQ7VcNE2/emSNV IxqRDXLh1nuNeJt9Uri2sHshii6oT1BXNUjMF8Hj9esNAnSIioB6kD1OR57DYDx2tEcA MgxyeYDLkHLz2OPX5aMmBY5rqner0UekUIzeuHZjswrO1uEeoKpQxC1j8TooH7pifRcJ fzM4GjrXyjR5AIERv8OW7WLDym4dvbwVmORlIH8UfhxPdz50aSgH2DcJd9wydr9FxoaB dSupOlftAqHgbwxpJJwGscHT2jImJVS/gcJKjxjz3k3WPXLaymThDjgQPLth+HzNYbHt cvlA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PNprb6YD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47067-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47067-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCUniHsbQn3FDg7MnPJcE7oY2+yKULpv8JiyV5RfaPyzFYJgL4UwQ8pgVnVMjIk0Ltcv6jtWWWfI9WC4s4eqnjgjnLCONg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s17-20020a056a0008d100b006dfbb278dd5si3219155pfu.236.2024.01.31.12.26.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 12:26:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47067-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PNprb6YD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47067-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47067-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E6C5D288147 for ; Wed, 31 Jan 2024 20:26:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 30ECE13B7A7; Wed, 31 Jan 2024 20:24:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PNprb6YD" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 53B41405FF; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; cv=none; b=lluPtye6TZARLTqrrDmbqOiLX/v6e1Kvzxij24/pZxGI7FJKWKT8ROdZUc2QRu7Pxo4vmHlsh1fedA5Own4t0sybH4KziPk2DXCmV62kTuj6kN2c/yfZW5brPnx/tiVKsApYKoJkRcu3DVIt7XqLC5mxhdrYlDQT8EaVUrhH0xs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; c=relaxed/simple; bh=wGJkNZWM5trjq8rhQ/Cfkn8OWEaE+kuNu9wG/5opVek=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=L8h6rf0WyNVXO+Dc3PQstNAOAzxFQdfeHrQ0+hkzsOiUlwC2HfzTqsU3b0LSa07kfP4ra6i4/69OtZl9juei725Mo433T9dHi86Ol5uWRAr3Iv11cj4+I+KR8GO0C03T7Qd/Ae1ybl3AbkBHqvWgRdSn/GC0zQvo0df0VvOhD54= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PNprb6YD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id D6E63C43390; Wed, 31 Jan 2024 20:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706732648; bh=wGJkNZWM5trjq8rhQ/Cfkn8OWEaE+kuNu9wG/5opVek=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=PNprb6YDsVQC9K+TZzrTZxVZajBZtbt0v8EZOLlsgo9ic6ZIKGgwYkpOu18ml/JPB 28BjIcm5oWk4O6LQLH+iiXEXcEXVa6seXpRmH6OrgZ2v/xJ93r3nXlP+LVdK8O27yU ibHmdCD0pFYnH0g1f1h3OrWJ4aBvRlp0M/IdmuhNXp7zjBVYBgAYtHzTz5xTs/KSBN 2KwOIuwx6xk6ziB6tee+6QrWwTQjkb7u5glUx6cA+3bAOZM5Wg29M4+irOTXT5crHh DYxVPQBdVQoh8fx4X4mnK8BX4gaXRgsseQ1PL7kRO21Bx0oNpq+7jwsMQZuh/a1vp2 Tmjs5CmJiEDNw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2C38C4828E; Wed, 31 Jan 2024 20:24:08 +0000 (UTC) From: Valentin Obst via B4 Relay Date: Wed, 31 Jan 2024 21:23:25 +0100 Subject: [PATCH v3 03/12] rust: ioctl: end top-level module docs with full stop Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240131-doc-fixes-v3-v3-3-0c8af94ed7de@valentinobst.de> References: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> In-Reply-To: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Valentin Obst , Trevor Gross , Martin Rodriguez Reboredo X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706732646; l=787; i=kernel@valentinobst.de; s=20240131; h=from:subject:message-id; bh=RnmjgqCkBgtaoPxCHzDBkuKFgg4rjvv/297TJiMhnEQ=; b=DFYaExxkBLacWrAXEjYrfqcfudJkoubWg1dEDgUS4NWXXUrugAr3GKNQOtG7EKqVDRcOEdWOY oGHG7IZ5INYD7JdP0I4w3Hacu97rtIsCPjclv3/mroltWwWdXZWc1sN X-Developer-Key: i=kernel@valentinobst.de; a=ed25519; pk=3s7U8y0mqkaiurgHSQQTYWOo2tw5HgzCg5vnJVfw37Y= X-Endpoint-Received: by B4 Relay for kernel@valentinobst.de/20240131 with auth_id=124 X-Original-From: Valentin Obst Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789639027774383325 X-GMAIL-MSGID: 1789639027774383325 From: Valentin Obst Every other module ends its first line of documentation with a full stop. Adapt the only outlier. Signed-off-by: Valentin Obst Reviewed-by: Trevor Gross Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Alice Ryhl --- rust/kernel/ioctl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/kernel/ioctl.rs b/rust/kernel/ioctl.rs index 59050e5f5a5a..5987ad6d38a7 100644 --- a/rust/kernel/ioctl.rs +++ b/rust/kernel/ioctl.rs @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 -//! ioctl() number definitions +//! ioctl() number definitions. //! //! C header: [`include/asm-generic/ioctl.h`](srctree/include/asm-generic/ioctl.h) From patchwork Wed Jan 31 20:23:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Obst via B4 Relay X-Patchwork-Id: 194925 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp4301dyc; Wed, 31 Jan 2024 12:28:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IGdaShPyQoimUr3DllxHFDnPVqU0Xv4SPKyRV72Fw4WhMIEipvi7/Ixzu04rXuBPeah6AZ3 X-Received: by 2002:a05:620a:394e:b0:785:43ef:99aa with SMTP id qs14-20020a05620a394e00b0078543ef99aamr236280qkn.50.1706732909363; Wed, 31 Jan 2024 12:28:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706732909; cv=pass; d=google.com; s=arc-20160816; b=cl9RUko0S3oMZT/wfJWt/b0rtWlglfCAV6WbWBZo4z5xqCmrAF5CUjwxgZiiTbYD9U RdzbmvJMfNUjB5xitoGQt4HbOtfk/6jV0tySBY7Pftry4wtzkF7nK/uzWCy5D/x/7X8a ZVffWQttK8Nw4Oyqw8Fgm1RnjX0oXYjP3TYYlJUFsT1oWeArAVUZb7x8UV2owTpPJifB +/+k1ZFuyQE5kSKJ4x/ZDuQdY08/DI7o1KtLb/s7x6vV1FKi7q0XgBX7lOgOV1FVLIgX j4sIsReY+aYXac+xz90IiYXIKfbcMdVMr1SBg9J9cTtfTUEOwRjUEy1MFKT7gPJyvUea /gdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=O60lgSOACH9U4hkUj/EiX1ibTPxm+TJYQaA/XdDxtfM=; fh=LxAPvi5zmrgE7e8Dvh+5MGMD/482tUUzwTpi+RgrRc8=; b=hEo9f055Ty5TipAdGnHHmSNxUQnOFnv8ab9oGngA7hZ3Ppc3eBEe/i3Oip8kdU5B0e s72OkKeZuroF4ARqbMpml7dKcCcnnraSDEGhsKbmbMu7fVM8+Bt8XQbQb78QfwSzPpMO pOaojRyKYCmaRpp96IG1Cpi10QWipGua59nPVX68Kdpqifb+tIeGVaDjN53kMCdoWaBZ FL7TRV1u800wdPkqIDCKvNX3SvW6+vL9Ozx1YiyILoYJck5wiaMyOGK6ycUp1JvuObcf Y++lYNZ6rQOeyQQqV69Hq1iap8mRFPQVZoUCn4eMSJt8Px/Sqzch777vGJue3+APVgsi YkCg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mf8FNPTV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47069-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47069-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCXjP7bwJtAySdjtGN7lAKeWvihjnm6CxeSYrUzBYfiwAs+DUBRJ4nx3wVMZGD7A6KApWZOmJvgNIBkEMYWHp7j35q+X/A== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b25-20020a05620a119900b00783f41175a9si9340987qkk.426.2024.01.31.12.28.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 12:28:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47069-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mf8FNPTV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47069-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47069-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 2ADEC1C20FCD for ; Wed, 31 Jan 2024 20:28:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE8AC13BE85; Wed, 31 Jan 2024 20:24:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mf8FNPTV" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 874163FB1E; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; cv=none; b=bGq16jAkYXFMXXX2FCwGkrL7mkeXaGoCcUoicEU8m5ekzsmHbquMvxV1VWSKV4Kgd6gdmz3Hqo+2iYhQ35NNpdS2pQNc1DSdi3dFVtj6XAkG/loytiiIVywXqTPGSzY4hoRYbCKeLPa49diN2yS93P1ojlBfrJwzzVK0i7gpEyY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; c=relaxed/simple; bh=kdmvq8FHVvrhi/nhman0CJ4rcR5nU6JHLMJSECky02U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=X0obyrUKO1zH/hsKu8UlJjR9/tOWj74XQHHbzVfakCeL9o9K5280UgfDo9IOtcWUrm51zGz9gzSbVjWzjACrNb13+1Xu1r8deh18MYO+RaUqi3Vk/EokpmauoEL2LR+MjNWr0njfRwbOxSoU8QTj2uLZxG6kCJKWt0l0cPGQYdE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mf8FNPTV; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id E4FF6C433B1; Wed, 31 Jan 2024 20:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706732649; bh=kdmvq8FHVvrhi/nhman0CJ4rcR5nU6JHLMJSECky02U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=mf8FNPTVEHtCFME3wbDfqX8jnVZPnLquQ0k0gghT4YZgFFDRo4r8sJ5jR7RDhQKLM sKRr1cvgO8gW5G7tY9VEB9rUHHlQVQjjXNttVeTefEMNoTzJNr9XZgeCa6pZg9VGqz NVnka9Y7Jib63yQlyvCdgfKrb+0CCxvS0YzyfG0zRKjk2QyjVVc3m5vcSjm92xHpot 9JWRqyW9p8fJtwpAxHwbaSR6QbBU9/X7OsWhpNxhgHk4S/ggOIPfxrsUWzXhw/7pH7 dM3ZBL4Q/k3KSQGz3WRnVxw3asICcsw32ztX8pOy+ayUeXXEBQ5OqpoCNW02ugz6RW P4sjJ/CDb/6eA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD724C4828D; Wed, 31 Jan 2024 20:24:08 +0000 (UTC) From: Valentin Obst via B4 Relay Date: Wed, 31 Jan 2024 21:23:26 +0100 Subject: [PATCH v3 04/12] rust: kernel: add srctree-relative doclinks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240131-doc-fixes-v3-v3-4-0c8af94ed7de@valentinobst.de> References: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> In-Reply-To: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Valentin Obst , Trevor Gross , Martin Rodriguez Reboredo X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706732646; l=1495; i=kernel@valentinobst.de; s=20240131; h=from:subject:message-id; bh=kLgaqmllmKNEoPT8KkSdoCC7kj+DdGrDcoL6QfU76KA=; b=7S3b+DjY5YBQva6+YSgVQsa22uB6Rj3uPyuLUNr8VssbgZuwJb/abEN7dWypql8P+MEF2keoc weVwL3OLTgqDx5AquVTxmPWwyq1xxyVqvm6sbHhS8rgqT9XMEwXLPWG X-Developer-Key: i=kernel@valentinobst.de; a=ed25519; pk=3s7U8y0mqkaiurgHSQQTYWOo2tw5HgzCg5vnJVfw37Y= X-Endpoint-Received: by B4 Relay for kernel@valentinobst.de/20240131 with auth_id=124 X-Original-From: Valentin Obst Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789639166914061805 X-GMAIL-MSGID: 1789639166914061805 From: Valentin Obst Convert existing references to C header files to make use of Commit bc2e7d5c298a ("rust: support `srctree`-relative links"). Signed-off-by: Valentin Obst Reviewed-by: Trevor Gross Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Alice Ryhl --- rust/kernel/lib.rs | 2 +- rust/kernel/sync/condvar.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs index b89ecf4e97a0..74581c958a6c 100644 --- a/rust/kernel/lib.rs +++ b/rust/kernel/lib.rs @@ -78,7 +78,7 @@ pub trait Module: Sized + Sync { /// Equivalent to `THIS_MODULE` in the C API. /// -/// C header: `include/linux/export.h` +/// C header: [`include/linux/export.h`](srctree/include/linux/export.h) pub struct ThisModule(*mut bindings::module); // SAFETY: `THIS_MODULE` may be used from all threads within a module. diff --git a/rust/kernel/sync/condvar.rs b/rust/kernel/sync/condvar.rs index 9f1d83589beb..fa1794972aa0 100644 --- a/rust/kernel/sync/condvar.rs +++ b/rust/kernel/sync/condvar.rs @@ -87,6 +87,8 @@ pub struct CondVar { /// A condvar needs to be pinned because it contains a [`struct list_head`] that is /// self-referential, so it cannot be safely moved once it is initialised. + /// + /// [`struct list_head`]: srctree/include/linux/types.h #[pin] _pin: PhantomPinned, } From patchwork Wed Jan 31 20:23:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Obst via B4 Relay X-Patchwork-Id: 194924 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp4296dyc; Wed, 31 Jan 2024 12:28:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtXz8raVhdxGZW1z4rOI8lWOQITzArWy2yZKhjhp1eLz0HRkJdEU6bUGeUKv2F4CffQnZx X-Received: by 2002:a05:6808:308c:b0:3be:49c9:472c with SMTP id bl12-20020a056808308c00b003be49c9472cmr272300oib.1.1706732908698; Wed, 31 Jan 2024 12:28:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706732908; cv=pass; d=google.com; s=arc-20160816; b=k3hlEif0PuxxbaFnQUqxihDbkVrfNdub3KE2aiI/5BLr4bCJeMf2XPVL+fK406hC54 beLldWONsqixAGKsdb7Cj7nMC/0/3jxP46DmYqe9O7v5IIuGgrOc87BhmUz0nC2rbVmE a9PKx6AX9/6H1TBqc86ap2OS7RnJumyKWL5ini7F3Wbk16zmG7Hnw6hC9B/uUt9lR7eF D68ic2hoYlONWKppvXfQ1chKwpqxqijbOioxdSNh6Eg79UZFiNF/+XzM64otu+utKanT 5xAVAQMdUasWPNNlRXRfkfBDcrxcPqF8W7EiPWp/2OmYnWZtcCV8D0y5fJOu2ZBxqHe/ T3oA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=xDejmAggceO3L1hDY+w7Rw2aJcwAnGehaQQ0PvfYMbU=; fh=r5YNXeBK899J6qlObeKp6lkuKSNvX2q2QDZ9t5Gc5x8=; b=n57s3zxQNAKBoBquMAt69qBdKYRXV/nVsy5mvIQe5zinYNzU8wq22xXGWpqvbJ39Fd oAW+rGrY8bdeufkYI7qlqVXXvP2Kl04IPcPtWTPb8ixdHIj50QCnY2KvsMG58+aLLHkY l5Zs6+3nKf2aCGBg8meZGiJNeOOcg/xqbTHae3pFw9mjedVNDPoHvbvghWDHvThXXBHa SzJv5l77km8A2sJM1s/YfMQzdmz3PNTenTqXkU3WW77NVzItmEGXR8/MeilSB+nGVhkl nOHfP61GUitwoQDa4OB0+OI33k9YkhvrbFBJjuAC/c0d+z2jJAJxigrwgsxpPeGkl2eU VG8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M3sn+vi6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47071-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47071-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCXaYWJObKC2R+bixPcvosNejhlDRK3aMBVw9hKqRZjy2BrJvvViakUamzHZ91UL9GzNhNfnEG73xnK4kNKfex2PoCfhfg== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y10-20020a05622a164a00b0042a084929d8si6127333qtj.787.2024.01.31.12.28.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 12:28:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47071-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M3sn+vi6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47071-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47071-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 793F61C21922 for ; Wed, 31 Jan 2024 20:28:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5E1B13B7B0; Wed, 31 Jan 2024 20:24:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M3sn+vi6" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 874433FB2C; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; cv=none; b=LSlXARwDDCIBkhm/fQUzCWin4SumC3T6zNEhTryyzeNXR/XmmaWgz6F8aoaMOeTrrCKWGf0D0LfvNBtKPKa+oeD7a+3y2XhIEqTdWS/PS1zx9kA6bxIaXgr2WuufWfkLyhJ78PeF+rkP9r+ydlq/nN9JUtV/LrOnRnZ/zUX7pKE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; c=relaxed/simple; bh=FA1F9SC1pBO6t7e2nw2RaFdLgUedeL9JkTxRX+R5a1k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IA8gcTj8m/20YHsW6z42z3di2PTlvjSDAFp63WRWZfGypkG0iATPdspnuJFriGE66o6gA02XT6UZ5qyoniEMAbscHkrfvzcALsAkmdeUA5+bDQt2tS5NHitj9tNWRiLR/kVrk7f3lRUZa3qGQuOfKjB+YpsLxoqGdZbVS9KeUN0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M3sn+vi6; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id EB7B1C433B2; Wed, 31 Jan 2024 20:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706732649; bh=FA1F9SC1pBO6t7e2nw2RaFdLgUedeL9JkTxRX+R5a1k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=M3sn+vi6Cu1BqqPG4lWEehKMEuMstzwT45trKG0phzxD+5JsFIKqi8OkMmlDTL2+F AlzQJUSUyetwBHWF4VtgFllYGxJCp6EPCJZ2XyjUTcZxiC2etr842ulVk4l3Ei/vmp nkg6L+eVT+xNK8uVB7F4vwzVRTPwPOga8Xrn6l1KsJb4P9a67xhCwt1lLjbdWz3/8t ZgKR6tTGj7kWigoktA5X3lOqh8bdbJJVgB6FmCPtRiZjmgePKU8J3cBnf3fZR+DFlJ UC0WycYvc5y4eY5W6VAvnmvGfDVJFUKfB2wgPaYuD/AmQpG/of6maTf6Q7SIW6ONSA v00MsMB5HIvdw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7B9DC48290; Wed, 31 Jan 2024 20:24:08 +0000 (UTC) From: Valentin Obst via B4 Relay Date: Wed, 31 Jan 2024 21:23:27 +0100 Subject: [PATCH v3 05/12] rust: str: use `NUL` instead of 0 in doc comments Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240131-doc-fixes-v3-v3-5-0c8af94ed7de@valentinobst.de> References: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> In-Reply-To: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Valentin Obst , Trevor Gross , Martin Rodriguez Reboredo X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706732646; l=1199; i=kernel@valentinobst.de; s=20240131; h=from:subject:message-id; bh=t90awkZOfJrNEj9Nqg9r3N76iP/cmOjmkwvkrtyw/9I=; b=hqfaaXwqKw/qal+VSCs0YjOz+bA68/qcnK/d1pbkLbyCibjtbc31Gxbrt1UfSfIgjGoTLjxY6 rJEeLkBTy2EDgEhqxS22yuDkLgnRAuGmCvQBc6KePEKQf5KT1v9gKbu X-Developer-Key: i=kernel@valentinobst.de; a=ed25519; pk=3s7U8y0mqkaiurgHSQQTYWOo2tw5HgzCg5vnJVfw37Y= X-Endpoint-Received: by B4 Relay for kernel@valentinobst.de/20240131 with auth_id=124 X-Original-From: Valentin Obst Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789639166820852886 X-GMAIL-MSGID: 1789639166820852886 From: Valentin Obst Throughout the module, bytes with the value zero are referred to as `NUL` bytes. Adapt the only two outliers. Signed-off-by: Valentin Obst Reviewed-by: Trevor Gross Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Alice Ryhl --- rust/kernel/str.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs index 0a8569594fc3..843ffeec9b3e 100644 --- a/rust/kernel/str.rs +++ b/rust/kernel/str.rs @@ -149,13 +149,13 @@ pub const fn as_char_ptr(&self) -> *const core::ffi::c_char { self.0.as_ptr() as _ } - /// Convert the string to a byte slice without the trailing 0 byte. + /// Convert the string to a byte slice without the trailing `NUL` byte. #[inline] pub fn as_bytes(&self) -> &[u8] { &self.0[..self.len()] } - /// Convert the string to a byte slice containing the trailing 0 byte. + /// Convert the string to a byte slice containing the trailing `NUL` byte. #[inline] pub const fn as_bytes_with_nul(&self) -> &[u8] { &self.0 From patchwork Wed Jan 31 20:23:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Valentin Obst via B4 Relay X-Patchwork-Id: 194929 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp4800dyc; Wed, 31 Jan 2024 12:29:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IE4scuAd8p4yzRdog7WYEMqiA/q6F6naX5Sz8QzoODwG13o3vkgJbvtq624TQeQzxnWdg79 X-Received: by 2002:a05:6a00:1792:b0:6de:8ad:dad1 with SMTP id s18-20020a056a00179200b006de08addad1mr3598745pfg.19.1706732967058; Wed, 31 Jan 2024 12:29:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706732967; cv=pass; d=google.com; s=arc-20160816; b=VF11CmoVR85+D9bMg8Jw9QZKiaLZPGnfqiRsUuBO4SXosAtZMfnB3SiWiQBIsju01j NwjORQMWY+Ly6xHgYuRdYTxImUA6Y4YR6/ciHyw01l8IhsAAJEIO5C8zGMA7VtkS32oK ikgDMo9UXGNkIFVKemJJgYLRAqV1Dp2+MlMwV0otsfS1sMIMfeTKLaFYrq8pSk8BE/TF ljZHdwhEZH4xG2IJ/ku9T3VqXfgdPRAKaRgzwJBVC5cJSo18UQHGVpiHBqZEDWnMQzAC yN4USc9GCWKLJX8CmBNHnnub0P4IAV8FkUql5AlL3nmtTvza5dX4LnAfnXbQ0RqSMEHZ rfrg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=KYug1IAVuqqYROXD6jjglOs4fsIk1n/6aBmZDRutRxY=; fh=vTj4Km4DYf3VWrqzU/BEdaiapvWynMkX3iMDDcHBGEQ=; b=tX7WsEacgDpn/3hFUo7oYNfjfQHs2rSBt+vtg36PURSXtGqRCZu9k9iw3KzqHGHWek njaRplOtlNWU8T5PsLg5vfORmD8x9JXdNJNA9f2rX+RVyG+uG3zQQTOfV99vu0v/tE1f 65n+26O96bQGO0gezSCk4wKtlM/oLsZfHepyn8QVsusDt25oxJvyAJQ3aJ7eLcoEJ2FD 01U3emW9WB7Z8oGF4P7yYWGe9IKLmcbooxQEdLnlYvyXKPeMbiCOqQo/1rJrWlB4GN4s WOl/WZ8vVbhXTyJj6p8A6MuwC0kx896RXxWpLC0o7zPoh363gav4Hx032CqBSMz8gcE8 VZGw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OuwgKaRI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47070-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47070-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWtsdHOJP13iaVCWPKDdujIj0mfSwfKk0eCye7aX5c0VdQTV5tjJTTF6inY1vLgi/FZyI/TvxpwnzKQ7ogxNSHEAYnmAw== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t14-20020a65608e000000b005d8e280c876si4181918pgu.729.2024.01.31.12.29.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 12:29:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47070-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OuwgKaRI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47070-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47070-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id BB324B25C49 for ; Wed, 31 Jan 2024 20:28:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE8E813BE8E; Wed, 31 Jan 2024 20:24:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OuwgKaRI" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 873DB3FB10; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; cv=none; b=IQmyLNfK9s9rhVpHtAGXds34McCkaZZPm+KENdXXKQLQMToDeLdupaeq+unKBuskKmPNDeZUx9w5LxIeG4p89htXxFRePWWix41l0vOsgRl7LRRPdpkMBhxTVDMpGcG+v1K44px5wKs7BBuyAwUP6zTQane3/kTpYYXs1tczJB4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; c=relaxed/simple; bh=qvu+Ox0zu6pevZi9vcwFq2laTuQ829Sreeg9+Gf9HMA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ha4CUTaAZ9GRhvTUOGYHn50lLJ0SL1CzkQxkyEr4GUYhdObWtpIGS8AKYKzQei2HM5oFHWcZbh+feRwT6ddaekj7EFJjtBmAO4R1x0Fome5NXwfdomW9tUxNu5xkB17a6vr/5IkG4VvkWpQYCAH6ae2gTaVUqXwepAk/W6gQBIU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OuwgKaRI; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 0167CC43609; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706732649; bh=qvu+Ox0zu6pevZi9vcwFq2laTuQ829Sreeg9+Gf9HMA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=OuwgKaRINXpUT2P3BU1WdF1vAyAXW3peXAdlYywNwt14Min7HHn7HD+6DU52/R/Z+ S/46KIJhqMw0JQsMvCD/rAVXWkthWfTH7thRZDYiG1tZwwITgxXRjmGUWYJKpN87og R6linx8xN+ucJpMVLwgW1eWRb5AAZ4JIM5y8KnK0KNS+o0nt7JEewgL0tzAVUnXqLb wU823bsaRnkJ3utxA0se8DmZ2RrdEcUJxcBisNyDL3fRPs3Y8gEFCoIpYnB4109SeV JqItdzw8Rq4kdq8m2RczMbzW3Zjlj4boiKzmnFhf68w7YS7+nK2mq2SXQfUtDViM3h 4q5o4Cke4OxOw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1D52C47258; Wed, 31 Jan 2024 20:24:08 +0000 (UTC) From: Valentin Obst via B4 Relay Date: Wed, 31 Jan 2024 21:23:28 +0100 Subject: [PATCH v3 06/12] rust: str: move SAFETY comment in front of unsafe block Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240131-doc-fixes-v3-v3-6-0c8af94ed7de@valentinobst.de> References: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> In-Reply-To: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Valentin Obst , Trevor Gross , Martin Rodriguez Reboredo X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706732646; l=1018; i=kernel@valentinobst.de; s=20240131; h=from:subject:message-id; bh=DDoG48Qq56LKmbADR58N8ly1qfgI3wpt9bk2atcwP2I=; b=MZe2Hxv9roGYl7lqeSTsKZTqoSJKgkFsgca/PD3aFOr4ulKBTBblhv38PbvagOpZGWXWbWtyj YNvZipM8WUGDw3pFzMQXX3OxChgETuOQVPLM3td+l4AGy5t/ZaHB/O5 X-Developer-Key: i=kernel@valentinobst.de; a=ed25519; pk=3s7U8y0mqkaiurgHSQQTYWOo2tw5HgzCg5vnJVfw37Y= X-Endpoint-Received: by B4 Relay for kernel@valentinobst.de/20240131 with auth_id=124 X-Original-From: Valentin Obst Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789639227924616559 X-GMAIL-MSGID: 1789639227924616559 From: Valentin Obst SAFETY comments should immediately precede the unsafe block they justify. Move assignment to `bar` past comment as it is safe. Signed-off-by: Valentin Obst Reviewed-by: Trevor Gross Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Alice Ryhl --- rust/kernel/str.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs index 843ffeec9b3e..fec5c4314758 100644 --- a/rust/kernel/str.rs +++ b/rust/kernel/str.rs @@ -191,9 +191,9 @@ pub fn to_str(&self) -> Result<&str, core::str::Utf8Error> { /// ``` /// # use kernel::c_str; /// # use kernel::str::CStr; + /// let bar = c_str!("ツ"); /// // SAFETY: String literals are guaranteed to be valid UTF-8 /// // by the Rust compiler. - /// let bar = c_str!("ツ"); /// assert_eq!(unsafe { bar.as_str_unchecked() }, "ツ"); /// ``` #[inline] From patchwork Wed Jan 31 20:23:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Obst via B4 Relay X-Patchwork-Id: 194930 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp5044dyc; Wed, 31 Jan 2024 12:29:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFXsfsZkqqKi0SA0YJJvklY9X/ZcQz5VLS4R26787FjHD5yCU5vespKoThRCfPq7/pdszjc X-Received: by 2002:a9d:76d7:0:b0:6db:db0f:9407 with SMTP id p23-20020a9d76d7000000b006dbdb0f9407mr2429095otl.8.1706732993056; Wed, 31 Jan 2024 12:29:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706732993; cv=pass; d=google.com; s=arc-20160816; b=CxI6m7LI2Q3Svaz+c8CpABxiJC8QWBENbvrRhgIcFWZBjEFTUf1mzV3Jh0Jl1AkhGm x2uB5x6TmT1jYhbZE3tUViReS3VpAE8kk++cq6USVfkmc2jpKetPvjoQca9td4mskXfn G4SAM5NfaDzlvGXdXDBulPjItXFXt6cuGZ9Y/e996HqvuL5YNykOjWHG3cPjWdbNu6+v RtcD2yB5GWPQg+yEiN/KeDe12MrnZl+oUdqZ7VP5pymSwRKyw6TNyq8ZvOpGcOO018ee C8JS0V8kbj1hZ5CB0eJy3SS6fv3WPoBbn6OWyNd+AT9NCQaNcd+WIDHSwOqs0VNrihD0 mG5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=tO4xnWoP/0c2Roo+0lfMmMXK+jq9L6BTGGQ8GT3erNw=; fh=cpmoqv0X/Rdyg7FohQ5DgXLNbSFZzEuAWDK2WR3iACA=; b=UigUh6bMG8IqBWYlhkQScs6Hp67tmAAPDumU0k3dCwG62+6xR/XES9HDbpTzMMx5dQ Kq7ydvpAsyr96FfsegREWaEvlNTMgIlsPFUkeTQixyGY1ZXjwij9qzBvwec1jAienE47 av/cCDIlpMyOjjgSHzW6/rRrD0Om7rQ8Hr8+IJQlMf9AJtOCxKNv7rcFCZZe/URWyT7v IdBTQW4KeqEfUzRR+T8xl0+1seutyBBdpIoICQP/PgMK85n9gVH/Tzn4K0lpholWxXPz zWIrlyji85FDQxi8ssduvXevgfssAZg/+EwD70wUhWKKCMmuGLWt9BDa70W0ADR5/DKi /0xA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZwJccGhP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47075-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47075-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCXURE2MCsKe0dTqunQb3tl/TNdw6jeXTZ62gnq9OXlEwJnLGoiwIlTxVEcj+tmfa2qfc5bM9acP8mNAB0KXKOqiobEtlA== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id l188-20020a6325c5000000b005d6dd7fab87si8754834pgl.884.2024.01.31.12.29.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 12:29:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47075-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZwJccGhP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47075-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47075-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id AF3A4B2815D for ; Wed, 31 Jan 2024 20:28:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C47E13EFE9; Wed, 31 Jan 2024 20:24:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZwJccGhP" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AF5837866F; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; cv=none; b=YyPtGRxSSzq6mqO5Q8hWAwNfKB26+xhpmG1ud7SC+rupq14aGcp5A8glAGIYc9xcFLPThSnMZxZgloSjqCiUgvsnfrSD0s+JuFuhhuSkMOZS6AC9ncFSf+XUAmxDa6G6i4Igkp8LqzRYTQFC/HIP+pwd4ceFwjBaso6UF+AChQY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; c=relaxed/simple; bh=qtayRPJ/adeWhbKoR+73scBOhW61yyOyCVFDV1rrQQk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XaZ5MGfA6CHeMrTyjvioDQK+h4D5jghyc0RBsfOEyto9iKQsnSgiSEz/25JC9tw4+3Hw+tufuGqA+E6luZjsQuNB83vQwll94ZC9rWsEL6P2g+al45srQ1/BnAv+6e7/tj41YZlbAcib3kKzMlbwyhX30Z8G+8IcbSnMAULMN7w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZwJccGhP; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 0950FC43141; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706732649; bh=qtayRPJ/adeWhbKoR+73scBOhW61yyOyCVFDV1rrQQk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ZwJccGhP4NSavvRUDPStbCopCAnVg+T68orFpmFbENGnAAyKO9FNEYjSx7u7J4Npd Saxl2THmCBTsFqOciattHbr+d0q8AkQb8ZXOHzj6rntt+Xf94a7pEI60WSCqaYxqQs 4p2GrkOi5MuCe5d/KMD0fRB7Ir278RgPq0sm3LnFpN7LZPd8hI0PiolupPwXM42bNb v5mBo97913g/+NmGa5uG5Tq/cgOoGkvKOMe9Vtg72rrZ1IaYjfTg5evWWyiWg0vVqR Go7zXPQM7s2sIYB35mvPp1KGGXAU7kUrTcHTdwR+Bb1sv0jEj1Cj031SoU3/ChDA2Z uXm+SIt635AGg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECF53C4828F; Wed, 31 Jan 2024 20:24:08 +0000 (UTC) From: Valentin Obst via B4 Relay Date: Wed, 31 Jan 2024 21:23:29 +0100 Subject: [PATCH v3 07/12] rust: kernel: unify spelling of refcount in docs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240131-doc-fixes-v3-v3-7-0c8af94ed7de@valentinobst.de> References: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> In-Reply-To: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Valentin Obst , Trevor Gross , Martin Rodriguez Reboredo X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706732646; l=3612; i=kernel@valentinobst.de; s=20240131; h=from:subject:message-id; bh=QKfC4Yx2YuMhbVoUU+HsBYOAmy4hrhjLwyi1rK9J+vA=; b=cJ0rU/cLrFYxQveHJSf8kBibCQ+wP0mbRY7IOhdp9xuHNGZCB9eWtfFYX5GKRhGxstervDr2Z 09J+P5+4MjYAYHLcf/aEy8xWjKU5IFP6K1Dt5JmFEeqja6W78i2fmGO X-Developer-Key: i=kernel@valentinobst.de; a=ed25519; pk=3s7U8y0mqkaiurgHSQQTYWOo2tw5HgzCg5vnJVfw37Y= X-Endpoint-Received: by B4 Relay for kernel@valentinobst.de/20240131 with auth_id=124 X-Original-From: Valentin Obst Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789639254438973152 X-GMAIL-MSGID: 1789639254438973152 From: Valentin Obst 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 Reviewed-by: Alice Ryhl --- 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 a3a4007db682..6726f1056066 100644 --- a/rust/kernel/task.rs +++ b/rust/kernel/task.rs @@ -39,7 +39,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 @@ -163,7 +163,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. From patchwork Wed Jan 31 20:23:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Obst via B4 Relay X-Patchwork-Id: 194921 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp3303dyc; Wed, 31 Jan 2024 12:26:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IHFzCqQBMHXzgCmTAhnrT+DmatJW/7Qhx5s7oetFBRoEBKBU+Fwtphj9sWh0CPOM2kXZliq X-Received: by 2002:a62:aa16:0:b0:6d9:af69:b704 with SMTP id e22-20020a62aa16000000b006d9af69b704mr2605040pff.13.1706732791696; Wed, 31 Jan 2024 12:26:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706732791; cv=pass; d=google.com; s=arc-20160816; b=AkI9cuEZRyKlPMyss2OXvgP5vFT1vDOm/U4R6LSI6zY8XumNbgpdtQKKQGBfQEpEVm YSJmkLRoBV7ll8cV4PWUIo9VxiS8rH10kkMgkMyhmjrOYui/AgNpEtQhMr8k69zylIE5 kS9hR7qtTRbrL7IL4r5/La1K8sx6tB9UpE4OMFy5PMwSzb/9v0lEsnXcbmiLu956j+Ur 9QjsJOvJgpw2xhua/a4TXi3v7p16Hs3QfM1JnyN1nsJVNZ784hRlcrO19zXx00IZUbFD bPYjP667UwYkER0UOoCYdKO6jhCqI+AT8+n894JNCPMMEIMktrYO4+3TmjsiuXiw4T3X tAFA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=MKQLwRB71coZp5N6n4prkas4FrmuRkkyL+t8JlE84eU=; fh=w9P4YEUzPUe4WWSbwCSUriEJSVUpt4dfgSH2fAKsgzI=; b=r1Ib3/2IC4LdrEBcOqIsnmtQQ3G2emfueGvtDUKsvjwulwoqPjp3Bq8euyf53qRNjQ ihodhDCV6O8OWRrG4zEtax6cmA5KUL2qFto+6waLhxZ/Jnx1MUyi9Qd5G9e7P4FWKxHx pSW4gzRww/xsSJ/JRawA9oIOg5p4QAR+CLQCXPEz4jZaQ1vvStmd3H0mVicj9e66VON+ tffN2vqEhaoNCbi8Bnz3Qy6ffSaMHna3+oIXxUk2rsg/1MFi5dqxXXihhl38YMLOVqVM k+MHnXWKsEQeWVDZJlgwkiB58b7JhNCrcOyl/vadngfdjjZG+S/NjDcKjW3PMWxWXGoj PBoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k0UzYpgw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47068-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47068-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWqUM+yZu/RjzcDszxJvq1HfGMYQs2ReVTi03bTkT9It3v3fhMJk3uOdePv6ybSIAFR+lilErgcEhQ3Dcqwu8UVAMmtVQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s17-20020a056a0008d100b006dfbb278dd5si3219155pfu.236.2024.01.31.12.26.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 12:26:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47068-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k0UzYpgw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47068-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47068-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 74EC82882E6 for ; Wed, 31 Jan 2024 20:26:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCC4013BEA1; Wed, 31 Jan 2024 20:24:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="k0UzYpgw" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7995C40BF0; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; cv=none; b=gHUaD7p6NgxwK73h9Ea0UinLaAds8izFEMQHVaDaKRY48PnhPbvKgQXZHcCWpGPlb7df9ZgATOswERP3jmQbMQkgDwTwH1qNgEHPEdYBP/Fha4IpUH+9v0mBdz6EE/c7J4exa22bduAzSIp+R6pMhzrbs0Nf/fA2Vw7fQIOJyV8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; c=relaxed/simple; bh=l5qTabcr/FSc8zBd9Snc6NefrNZmSs4e6M9FZdZKYQk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IAr4vN8XdVTGGtOJbY6OiHb/90P95/QhToOm4pT4DY/6Y/2mJ/WvlovkhznfguIGdNuD8jrxE8l5rueFe748SmjaGDU4Cm/47mIPyK1VdXqC3yiEfRpYqyNq3wXGs82ExsVwYCsP2AX+Fuqi1Ztq8qDVAmg010pb758XK3F17bE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=k0UzYpgw; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 166E4C4166B; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706732649; bh=l5qTabcr/FSc8zBd9Snc6NefrNZmSs4e6M9FZdZKYQk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=k0UzYpgwyLiQrRKo8FEWyGL/vwl8eeYoF1n+sNcdZk8qajyxBqK1VP3bCjz7rjzsW iy9ThfMXpOqyTMeZ6y7Y8Gj7kxHydvDldnyv1OoCp3lnsJsKdLLaPaS1GviHilXQ36 ekyoDesHIxu80HF39GWlNV0VUjSnFSHv7RlNIgPiSPow6E4wOVBB/pwik/6uh6xPiI Q+f+4cU5aFHdOt4THg+PKo6bXqoXe47qkz/Ax6MBPFtP/4GVNn5UO2G0HsIoMSxBwI 9z95+Dewl84Gs2LIeiEH3M2AP9f1wYPvBIaNAhxoAcuh+PiyTsJsyr1S3mAkgKjb2S u0iWutdAnsoUQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 043D4C4828E; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) From: Valentin Obst via B4 Relay Date: Wed, 31 Jan 2024 21:23:30 +0100 Subject: [PATCH v3 08/12] rust: kernel: mark code fragments in docs with backticks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240131-doc-fixes-v3-v3-8-0c8af94ed7de@valentinobst.de> References: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> In-Reply-To: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Valentin Obst , Trevor Gross , Martin Rodriguez Reboredo X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706732646; l=3807; i=kernel@valentinobst.de; s=20240131; h=from:subject:message-id; bh=J5dTHNR//Nnyw4X8Q/8C/mtX7OP1rzCZ6Zxen8pohMw=; b=HpgEriZmFxlMj6UQF50GllImTwzlcqVkT988KRK6iiTbNvDURVqFTmz0Sq4w5/UCq5EkM0OCQ kCT334V3M6HC7d3a+bS/t9UEn7IxBQftdV1bPp3QnO60rdWZAnLX9kN X-Developer-Key: i=kernel@valentinobst.de; a=ed25519; pk=3s7U8y0mqkaiurgHSQQTYWOo2tw5HgzCg5vnJVfw37Y= X-Endpoint-Received: by B4 Relay for kernel@valentinobst.de/20240131 with auth_id=124 X-Original-From: Valentin Obst Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789639043712481641 X-GMAIL-MSGID: 1789639043712481641 From: Valentin Obst Fix places where comments include code fragments that are not enclosed in backticks. Signed-off-by: Valentin Obst Reviewed-by: Trevor Gross Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Alice Ryhl --- rust/kernel/ioctl.rs | 2 +- rust/kernel/sync/lock.rs | 2 +- rust/kernel/task.rs | 2 +- rust/kernel/workqueue.rs | 9 +++++---- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/rust/kernel/ioctl.rs b/rust/kernel/ioctl.rs index 5987ad6d38a7..cfa7d080b531 100644 --- a/rust/kernel/ioctl.rs +++ b/rust/kernel/ioctl.rs @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 -//! ioctl() number definitions. +//! `ioctl()` number definitions. //! //! C header: [`include/asm-generic/ioctl.h`](srctree/include/asm-generic/ioctl.h) diff --git a/rust/kernel/sync/lock.rs b/rust/kernel/sync/lock.rs index 072b8ef2a0fa..10ccc0e39147 100644 --- a/rust/kernel/sync/lock.rs +++ b/rust/kernel/sync/lock.rs @@ -28,7 +28,7 @@ pub unsafe trait Backend { /// The state required by the lock. type State; - /// The state required to be kept between lock and unlock. + /// The state required to be kept between `lock` and `unlock`. type GuardState; /// Initialises the lock. diff --git a/rust/kernel/task.rs b/rust/kernel/task.rs index 6726f1056066..ca6e7e31d71c 100644 --- a/rust/kernel/task.rs +++ b/rust/kernel/task.rs @@ -132,7 +132,7 @@ fn deref(&self) -> &Self::Target { /// Returns the group leader of the given task. pub fn group_leader(&self) -> &Task { // SAFETY: By the type invariant, we know that `self.0` is a valid task. Valid tasks always - // have a valid group_leader. + // have a valid `group_leader`. let ptr = unsafe { *ptr::addr_of!((*self.0.get()).group_leader) }; // SAFETY: The lifetime of the returned task reference is tied to the lifetime of `self`, diff --git a/rust/kernel/workqueue.rs b/rust/kernel/workqueue.rs index 8775c34d12a5..d900dc911149 100644 --- a/rust/kernel/workqueue.rs +++ b/rust/kernel/workqueue.rs @@ -168,7 +168,7 @@ impl Queue { /// # Safety /// /// The caller must ensure that the provided raw pointer is not dangling, that it points at a - /// valid workqueue, and that it remains valid until the end of 'a. + /// valid workqueue, and that it remains valid until the end of `'a`. pub unsafe fn from_raw<'a>(ptr: *const bindings::workqueue_struct) -> &'a Queue { // SAFETY: The `Queue` type is `#[repr(transparent)]`, so the pointer cast is valid. The // caller promises that the pointer is not dangling. @@ -414,8 +414,8 @@ pub unsafe fn raw_get(ptr: *const Self) -> *mut bindings::work_struct { /// /// # Safety /// -/// The [`OFFSET`] constant must be the offset of a field in Self of type [`Work`]. The methods on -/// this trait must have exactly the behavior that the definitions given below have. +/// The [`OFFSET`] constant must be the offset of a field in `Self` of type [`Work`]. The +/// methods on this trait must have exactly the behavior that the definitions given below have. /// /// [`Work`]: Work /// [`impl_has_work!`]: crate::impl_has_work @@ -428,7 +428,8 @@ pub unsafe trait HasWork { /// Returns the offset of the [`Work`] field. /// - /// This method exists because the [`OFFSET`] constant cannot be accessed if the type is not Sized. + /// This method exists because the [`OFFSET`] constant cannot be accessed if the type is not + /// `Sized`. /// /// [`Work`]: Work /// [`OFFSET`]: HasWork::OFFSET From patchwork Wed Jan 31 20:23:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Obst via B4 Relay X-Patchwork-Id: 194926 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp4408dyc; Wed, 31 Jan 2024 12:28:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHS3+OJWLUbYfFq1VE1XGy8QLubEkTdqvURJ2famY8dr4seQrYsPeb4a91QzBzu/VVYDd98 X-Received: by 2002:a05:620a:4ac1:b0:785:3fcc:341e with SMTP id sq1-20020a05620a4ac100b007853fcc341emr572227qkn.10.1706732920691; Wed, 31 Jan 2024 12:28:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706732920; cv=pass; d=google.com; s=arc-20160816; b=Pefc8vAqYDaNQf3FMbmt9rhNiy0et/0iZqlYTp0B0wJpYG0bEiQk4/zuwiYOb68mJ7 FLUZqZ3kfx+l7zfvBKTfEjHckh9nZUXZ7ytX+tPUV80iAFk5oPbzVq+3XKX70mImXfzg vN/0H0kyvS99utbnxFBP4SkRq83d122mWrziR7YKuLGxbvLMcbRgDDt1TAMletiyoYQI meNqmjm0Gub6PBpO5xaYrUMXS0hfKUFsnP8vc0KS07hGc2CIGGjKcyF+mc88vYxpQL6l /TpSHbDzcNMgUpALsSpkXlpUJg+U86JmbRce0sEkB7xSNDmqpIzmqVNGpeh2fJKTwtve oPrQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=prXxJyC/ZQcQzifiUmAM+NE/1512iPupsl9iZCvbPFA=; fh=lH9CNV1Gx8+UT3nMVghpvKb2Utuax1jPQ8/Qghp/xaU=; b=x/70I6JJi3FVtD4tmMPrl05u1Xb/EhzeHbobRTL6mQiXBEQfZITYYLiszaMUvE0S8K BTn6p8ELGb3Qp0eQYrfaQ7Exu4QhddMuT4EnzVK6Wvj2dmquTftesT8OPVFiVxWaY4Ah KLub8ie+CaST4TpS9gyTho5+prmQ6xI8GbNuIBlUtdYmFa8ijrSR/sr8nw8buLQEpfus fXCVd2cwvj1kuD++JL1Av2FFsg6B4OC8RbyjGxyqm+XCR9OOIcFY71dEl0aR8iPnbyr/ s1EVLiPMMwLlfJt72Fz+ui28WpBb//h24qtX9nBmHMdIe9YZuTR1wWJ3lIj57ShivjuZ 3qVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rGExPr9+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47073-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47073-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWgQdr/Rsgu9Xf6AD8FdIqkJ4DjsI1B0M2TQ/x0td7w3DT0KpXQRe4hM1SFefJdmlLen3pu4mWbyqLKEAQl1PjYMTFQwA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b25-20020a05620a119900b00783f41175a9si9340987qkk.426.2024.01.31.12.28.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 12:28:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47073-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rGExPr9+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47073-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47073-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 7BF8C1C22D59 for ; Wed, 31 Jan 2024 20:28:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F1A7613E22C; Wed, 31 Jan 2024 20:24:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rGExPr9+" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8C3F35D90E; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; cv=none; b=Mca4QRsTfZfce+HNQjaj98RZ2c7P3ES/4pV+z65bR4KUM3SQHbkzRQGvs3Aq/PRh9K0Rcd/th+3SkfRu4d4soGYsFKr0oK3bvUhHIadYsv6v6Hrrn2rUz/QIbR4B4gTy+aH7Kg2Ae1TR7wiEdXMmWy3RkAIVuRCFOZ+Ve8gHTWI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; c=relaxed/simple; bh=oEOEYI5XD7Gl9YRicVq5JZCnoGI82gQIloe6mONRHjU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XgIZDLYFqIS9OhVCQ3jyJ4ioNa+JAjBWUVXhDV1P7tO3rwmD8rnLsyp9jP7872FgfD77y672BHFC2QfxOTjGtGQlJTqxw3FyqhtC2GxkFbGwaZ8I+hZyzXMY7ZkzLh6jwSGJKcjBkxSrvM/7NZgDvYXb3DZn7XosqxdzcqXsoR8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rGExPr9+; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 1F205C4166C; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706732649; bh=oEOEYI5XD7Gl9YRicVq5JZCnoGI82gQIloe6mONRHjU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=rGExPr9+3ePh7IQJE1IiBqRGNyopfOoMG0OTUQ0ZNelBntg7+PMd6SILPolM6XYg+ q8InwkqMCMp8fzu5jzSomz190Id6CC7IV+hN4VOlbuWyz+5jjHJdCQz4RApuOQK2GT XXBl6x957ki7uhKVEbxo60AchBYFGaDxbeMWHKsGQ+VCoZ7rMPQVzqJT8pw6kfSt/R BJacbHKDBijbyldbvGPVkwIwBcdAEgHMrquzhA6V3Vrs4keXq47aNc/yPGXxDokjRU TGOEnqmRIjsd0KG/UwIWwZsqO/JIJR2EcfCqmrJqSHZ+mcPc+j48+n9U1idTkfmxqS gcLFGzEuwog1w== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EB54C48291; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) From: Valentin Obst via B4 Relay Date: Wed, 31 Jan 2024 21:23:31 +0100 Subject: [PATCH v3 09/12] rust: kernel: add blank lines in front of code blocks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240131-doc-fixes-v3-v3-9-0c8af94ed7de@valentinobst.de> References: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> In-Reply-To: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Valentin Obst , Trevor Gross , Martin Rodriguez Reboredo X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706732646; l=1527; i=kernel@valentinobst.de; s=20240131; h=from:subject:message-id; bh=uY1sZnb/LMfFXaWeBAwEM8DMFKBsaytN4jZN05O/ykE=; b=99dau8uj89rQF+Ui2JVfPI4xnHVD6+T01C8FkwBqgFe94TWEWf3h/+vqiyLPqj9bgVxIXeeWy Sz7HbN+z06sBam3gLTECfS+tY1SSHGwiOu6AV7FDJFKsZ4pC8ygnQKz X-Developer-Key: i=kernel@valentinobst.de; a=ed25519; pk=3s7U8y0mqkaiurgHSQQTYWOo2tw5HgzCg5vnJVfw37Y= X-Endpoint-Received: by B4 Relay for kernel@valentinobst.de/20240131 with auth_id=124 X-Original-From: Valentin Obst Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789639178899087285 X-GMAIL-MSGID: 1789639178899087285 From: Valentin Obst Throughout the code base, blank lines are used before starting a code block. Adapt outliers to improve consistency within the kernel crate. Signed-off-by: Valentin Obst Reviewed-by: Trevor Gross Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Alice Ryhl --- rust/kernel/types.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rust/kernel/types.rs b/rust/kernel/types.rs index fdb778e65d79..8aabe348b194 100644 --- a/rust/kernel/types.rs +++ b/rust/kernel/types.rs @@ -90,6 +90,7 @@ unsafe fn from_foreign(_: *const core::ffi::c_void) -> Self {} /// /// In the example below, we have multiple exit paths and we want to log regardless of which one is /// taken: +/// /// ``` /// # use kernel::types::ScopeGuard; /// fn example1(arg: bool) { @@ -108,6 +109,7 @@ unsafe fn from_foreign(_: *const core::ffi::c_void) -> Self {} /// /// In the example below, we want to log the same message on all early exits but a different one on /// the main exit path: +/// /// ``` /// # use kernel::types::ScopeGuard; /// fn example2(arg: bool) { @@ -129,6 +131,7 @@ unsafe fn from_foreign(_: *const core::ffi::c_void) -> Self {} /// /// In the example below, we need a mutable object (the vector) to be accessible within the log /// function, so we wrap it in the [`ScopeGuard`]: +/// /// ``` /// # use kernel::types::ScopeGuard; /// fn example3(arg: bool) -> Result { From patchwork Wed Jan 31 20:23:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Obst via B4 Relay X-Patchwork-Id: 194931 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp5165dyc; Wed, 31 Jan 2024 12:30:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGk9pHjJdbmBhI8TslkflSbwXjahWb7rrR+eHfnPgJHJQzOKyCgwxvqhpOX7/dzXF5LOswQ X-Received: by 2002:a05:6870:b48b:b0:210:ebaf:86c6 with SMTP id y11-20020a056870b48b00b00210ebaf86c6mr354171oap.36.1706733004549; Wed, 31 Jan 2024 12:30:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706733004; cv=pass; d=google.com; s=arc-20160816; b=Q7+3PDEFp5l5+ePqvlM+NnYJAmnn/YbRxBrJb62iHoyGE3x6oS1br0G0kOCnbZUCJK w/U+tBu88LQDJAoju1FqcoTzytnqVszNzP6U5bUh6f3pgf3h4tjrjX5DPbBu4Misv3/j AUwwJW5x+WZlCGdYuGEOnbZWfz4eOjTgFGVIRqaC2Xqtsazh1yg7+qptoSfP0ktcXHVY myZ0sg25zU/sJhf6bq0iy//PZZcD0Qsgoa6pnTtra2mj6/7xuPFQ44rPGCNxV40p4ibR 0IQJfDANckIoygpyscszN3aBuc/qgC8GSDSjr+4VfepbVruLdj+vo72AHC21r8y2Hwxb re3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=ME2KCEsP7OA1thHrJFksGB0bf+kxLWrWYzD24TXElM8=; fh=1x3t3AzN2sW4iBifqToK62eiUvzKHfqjf65pSQ45mro=; b=MrRegl3tLMIezfONHlNn7DGR3nM5GKLMXILpdsPV1RWp9EuB2GRuTkycu54vWGt7dU Z1UjuDaEeNIF77CSfj/xCphxvPo98L6Z9fA6WKj2JlqI6h+gdIb9TUesaJXSn6dSKPNK 1Kge9g7n8JV0ADGogQvpCPxzaoMMXA4Mt+TmvbARYrBEj7cR7tZBrB/X2GjzfPNdd2Es pNB+Wkjn2SkfiAxD4zmy1lVV2scpK/hKc4fdRRb8rbOhZHO3osbQj/T9EeE8h3HMFba7 pSIvLvxsSvwCJG5cwDiZCjtvKxlePCyyiB9u6xRF58ulW3TXOIVVGW36PgG2rZcNDOq4 XIYw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="mxAIl+/U"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47072-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47072-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWdcAAPG94Nkit/colseWHqx4thvcLozWH22wOuosM0pcUOpyseJJ2/f/SMTCHuDgyGhrSFM3a87WPR2KpQX8P8LFRtrw== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id l38-20020a635b66000000b005cee03a5355si9798428pgm.518.2024.01.31.12.30.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 12:30:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47072-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="mxAIl+/U"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47072-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47072-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7032DB281EE for ; Wed, 31 Jan 2024 20:29:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32A8813F004; Wed, 31 Jan 2024 20:24:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mxAIl+/U" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 89F383FE24; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; cv=none; b=Ya8YX7y6ALWZx+Z7Crv1AodviFhXb6HEVyU0pYYqZBFpd+bIUxipNjxMVNVAictAvFVsk8GA97PJ83EtNTk97KRjSSHO1kf2t/VS0UpQ/i42raiXnPbPXvl8i7bdaSKkzZbOEDYT25zrw2DA8oc3p0ip6ZQy4fdJJNXjdc9dLyQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; c=relaxed/simple; bh=GarbNP+2iuIwr6VxBD7bVTYXmjv1I2yVW0qul64RfeA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ifAvwbIittZgjmNb2h1EGYj2gr7DXgac+5/4HKNyb//UIFhCOoxkmHbjXwixnGWcfc7SePJZbkB80LX2dcA/ojUPv/bMLqkiMrxMptxFqZ//Z2FpIpqmL3uZjWOlXXDdw6dk+/kWb4BtIbbU3yatQsvtUauF0i3+wkkarLmidYg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mxAIl+/U; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 2AD03C41674; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706732649; bh=GarbNP+2iuIwr6VxBD7bVTYXmjv1I2yVW0qul64RfeA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=mxAIl+/UeHg4Y+01Q2LDQ93mLlXEwonoxVcEvnu9lOv2UspOYOR/y/3LFL0tPqrW3 471t7BwNr8mJjTr5CnlID2RyJ5XAF96K5IzrKdmUjNsodPXA0sK395b7Kice2z4mk6 sWxJrBxrKdw2INKj0FvwtzgU7ibOp4+QNf1ywH/YJToe2Q6R9jWPgraDgwLCsIdoc8 O6yPFHaKrLl1NsTm2f8scj5PSA2vD8NOroDPwrwQRizKr3L6vGKEg2jumicnqU9OW4 xLIlkNi1fpKAyGaiMJT8ydmNh81/lJo37OjOLK+5C3nAgIOoPCwMCwO/gOD1Ou2+qZ KsdltbFS/ML9A== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 194AEC47DB3; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) From: Valentin Obst via B4 Relay Date: Wed, 31 Jan 2024 21:23:32 +0100 Subject: [PATCH v3 10/12] rust: kernel: add doclinks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240131-doc-fixes-v3-v3-10-0c8af94ed7de@valentinobst.de> References: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> In-Reply-To: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Valentin Obst , Trevor Gross , Martin Rodriguez Reboredo X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706732646; l=8480; i=kernel@valentinobst.de; s=20240131; h=from:subject:message-id; bh=+UXljfH8wlx7xaY4WJ467vxrBsuNMbjA2jEIytFPfIs=; b=rj2UxYJPHYdYlXqRXd4c6xgALp7XYJwoNoByMd3YVtyR7KVpB6mNm0amP9b+45CxN6jo5OOEf t0qmiR4CqhGCG/XkubDOwhShE9UQV1SqSjwNrDSxEV1N/xcgGZV/Rl3 X-Developer-Key: i=kernel@valentinobst.de; a=ed25519; pk=3s7U8y0mqkaiurgHSQQTYWOo2tw5HgzCg5vnJVfw37Y= X-Endpoint-Received: by B4 Relay for kernel@valentinobst.de/20240131 with auth_id=124 X-Original-From: Valentin Obst Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789639267233177836 X-GMAIL-MSGID: 1789639267233177836 From: Valentin Obst Add doclinks to existing documentation. Signed-off-by: Valentin Obst Reviewed-by: Trevor Gross Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Alice Ryhl --- rust/kernel/sync/arc.rs | 6 +++--- rust/kernel/sync/lock.rs | 13 ++++++++++--- rust/kernel/workqueue.rs | 45 +++++++++++++++++++++++++++------------------ 3 files changed, 40 insertions(+), 24 deletions(-) diff --git a/rust/kernel/sync/arc.rs b/rust/kernel/sync/arc.rs index 6c46b1affca5..936bc549a082 100644 --- a/rust/kernel/sync/arc.rs +++ b/rust/kernel/sync/arc.rs @@ -365,12 +365,12 @@ fn from(item: Pin>) -> Self { /// A borrowed reference to an [`Arc`] instance. /// /// For cases when one doesn't ever need to increment the refcount on the allocation, it is simpler -/// to use just `&T`, which we can trivially get from an `Arc` instance. +/// to use just `&T`, which we can trivially get from an [`Arc`] instance. /// /// However, when one may need to increment the refcount, it is preferable to use an `ArcBorrow` /// over `&Arc` because the latter results in a double-indirection: a pointer (shared reference) -/// to a pointer (`Arc`) to the object (`T`). An [`ArcBorrow`] eliminates this double -/// indirection while still allowing one to increment the refcount and getting an `Arc` when/if +/// to a pointer ([`Arc`]) to the object (`T`). An [`ArcBorrow`] eliminates this double +/// indirection while still allowing one to increment the refcount and getting an [`Arc`] when/if /// needed. /// /// # Invariants diff --git a/rust/kernel/sync/lock.rs b/rust/kernel/sync/lock.rs index 10ccc0e39147..5b5c8efe427a 100644 --- a/rust/kernel/sync/lock.rs +++ b/rust/kernel/sync/lock.rs @@ -21,14 +21,21 @@ /// # Safety /// /// - Implementers must ensure that only one thread/CPU may access the protected data once the lock -/// is owned, that is, between calls to `lock` and `unlock`. -/// - Implementers must also ensure that `relock` uses the same locking method as the original +/// is owned, that is, between calls to [`lock`] and [`unlock`]. +/// - Implementers must also ensure that [`relock`] uses the same locking method as the original /// lock operation. +/// +/// [`lock`]: Backend::lock +/// [`unlock`]: Backend::unlock +/// [`relock`]: Backend::relock pub unsafe trait Backend { /// The state required by the lock. type State; - /// The state required to be kept between `lock` and `unlock`. + /// The state required to be kept between [`lock`] and [`unlock`]. + /// + /// [`lock`]: Backend::lock + /// [`unlock`]: Backend::unlock type GuardState; /// Initialises the lock. diff --git a/rust/kernel/workqueue.rs b/rust/kernel/workqueue.rs index d900dc911149..ed3af3491b47 100644 --- a/rust/kernel/workqueue.rs +++ b/rust/kernel/workqueue.rs @@ -12,19 +12,19 @@ //! //! # The raw API //! -//! The raw API consists of the `RawWorkItem` trait, where the work item needs to provide an +//! The raw API consists of the [`RawWorkItem`] trait, where the work item needs to provide an //! arbitrary function that knows how to enqueue the work item. It should usually not be used //! directly, but if you want to, you can use it without using the pieces from the safe API. //! //! # The safe API //! -//! The safe API is used via the `Work` struct and `WorkItem` traits. Furthermore, it also includes -//! a trait called `WorkItemPointer`, which is usually not used directly by the user. +//! The safe API is used via the [`Work`] struct and [`WorkItem`] traits. Furthermore, it also +//! includes a trait called [`WorkItemPointer`], which is usually not used directly by the user. //! -//! * The `Work` struct is the Rust wrapper for the C `work_struct` type. -//! * The `WorkItem` trait is implemented for structs that can be enqueued to a workqueue. -//! * The `WorkItemPointer` trait is implemented for the pointer type that points at a something -//! that implements `WorkItem`. +//! * The [`Work`] struct is the Rust wrapper for the C `work_struct` type. +//! * The [`WorkItem`] trait is implemented for structs that can be enqueued to a workqueue. +//! * The [`WorkItemPointer`] trait is implemented for the pointer type that points at a something +//! that implements [`WorkItem`]. //! //! ## Example //! @@ -218,7 +218,9 @@ pub fn try_spawn(&self, func: T) -> Result<(), All } } -/// A helper type used in `try_spawn`. +/// A helper type used in [`try_spawn`]. +/// +/// [`try_spawn`]: Queue::try_spawn #[pin_data] struct ClosureWork { #[pin] @@ -258,9 +260,11 @@ fn run(mut this: Pin>) { /// /// # Safety /// -/// Implementers must ensure that any pointers passed to a `queue_work_on` closure by `__enqueue` +/// Implementers must ensure that any pointers passed to a `queue_work_on` closure by [`__enqueue`] /// remain valid for the duration specified in the guarantees section of the documentation for -/// `__enqueue`. +/// [`__enqueue`]. +/// +/// [`__enqueue`]: RawWorkItem::__enqueue pub unsafe trait RawWorkItem { /// The return type of [`Queue::enqueue`]. type EnqueueOutput; @@ -290,10 +294,11 @@ unsafe fn __enqueue(self, queue_work_on: F) -> Self::EnqueueOutput /// Defines the method that should be called directly when a work item is executed. /// -/// This trait is implemented by `Pin>` and `Arc`, and is mainly intended to be +/// This trait is implemented by `Pin>` and [`Arc`], and is mainly intended to be /// implemented for smart pointer types. For your own structs, you would implement [`WorkItem`] -/// instead. The `run` method on this trait will usually just perform the appropriate -/// `container_of` translation and then call into the `run` method from the [`WorkItem`] trait. +/// instead. The [`run`] method on this trait will usually just perform the appropriate +/// `container_of` translation and then call into the [`run`][WorkItem::run] method from the +/// [`WorkItem`] trait. /// /// This trait is used when the `work_struct` field is defined using the [`Work`] helper. /// @@ -309,8 +314,10 @@ pub unsafe trait WorkItemPointer: RawWorkItem { /// /// # Safety /// - /// The provided `work_struct` pointer must originate from a previous call to `__enqueue` where - /// the `queue_work_on` closure returned true, and the pointer must still be valid. + /// The provided `work_struct` pointer must originate from a previous call to [`__enqueue`] + /// where the `queue_work_on` closure returned true, and the pointer must still be valid. + /// + /// [`__enqueue`]: RawWorkItem::__enqueue unsafe extern "C" fn run(ptr: *mut bindings::work_struct); } @@ -328,12 +335,14 @@ pub trait WorkItem { /// Links for a work item. /// -/// This struct contains a function pointer to the `run` function from the [`WorkItemPointer`] +/// This struct contains a function pointer to the [`run`] function from the [`WorkItemPointer`] /// trait, and defines the linked list pointers necessary to enqueue a work item in a workqueue. /// /// Wraps the kernel's C `struct work_struct`. /// /// This is a helper type used to associate a `work_struct` with the [`WorkItem`] that uses it. +/// +/// [`run`]: WorkItemPointer::run #[repr(transparent)] pub struct Work { work: Opaque, @@ -409,7 +418,7 @@ pub unsafe fn raw_get(ptr: *const Self) -> *mut bindings::work_struct { /// } /// ``` /// -/// Note that since the `Work` type is annotated with an id, you can have several `work_struct` +/// Note that since the [`Work`] type is annotated with an id, you can have several `work_struct` /// fields by using a different id for each one. /// /// # Safety @@ -429,7 +438,7 @@ pub unsafe trait HasWork { /// Returns the offset of the [`Work`] field. /// /// This method exists because the [`OFFSET`] constant cannot be accessed if the type is not - /// `Sized`. + /// [`Sized`]. /// /// [`Work`]: Work /// [`OFFSET`]: HasWork::OFFSET From patchwork Wed Jan 31 20:23:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Obst via B4 Relay X-Patchwork-Id: 194928 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp4537dyc; Wed, 31 Jan 2024 12:28:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHiR0XPNJrR6oqxaRPTBxR9VPpeidBzKx2s3T5+6FFTe7e1J0Txe+5R43LMv/Rphffvye8v X-Received: by 2002:a17:906:7d6:b0:a35:7438:1136 with SMTP id m22-20020a17090607d600b00a3574381136mr246566ejc.70.1706732938386; Wed, 31 Jan 2024 12:28:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706732938; cv=pass; d=google.com; s=arc-20160816; b=o8uccTJdRXNfoLXrf8LA0fc9M2XJUo6Qf3Y+QWyT/wI6z+pQxrB0WTx92t+M8cIoxg U51jITXMsqnjw/XcyACGdXNJdGOldLCxosWLiAMEkY/BwgVVituSrI0nKsTSgYq4lQ31 tqDbhA81N5Bin919uepkSIeFFFtEBBX2czin1J2vO5ljbkm3BFkcC96SJSCVGUQyHNaD PibkYh4bZlWkBpeNI4mUmi/nHzLt2q7FvyMKJXvHqeFUa53vhkPzWqLGHC4bsEyzaRgm CYXpd9vnw00dybMlIQzEpkw/80uQZE8OxlYpbCa8Kd/4xK5dr9lguzIXknwcTDvqJyfm lGlA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=DpFTyt5ur47sRBJH6DJrr4WHWbVMdbVpsfLjsG6mtG4=; fh=psSI67ao4zJ6Lt3KqL+ritwaM0DRQ2U0Xup+mIf1Vgk=; b=nzkLQvB621yErIQ7ihBAEo+3yEnjVxGu6p/AYi9RW7h2+f2RgAlwQPQXHvV5iZMHD6 XRS23gGSERHRxiq7FC3WV47fyXho4H1OtnTx2ZprL2kiXPmZCkfOkD7fwqPrByGsZ73z SlvIjPLZqMAylaZgelHkSbUI7BqIII2eYnKXihRtkKVk+b13Zvj9TJTUS6vSTRw0O0ww A/nkt6PTkYRLUe2kp9+/a9RqIkxv+UrwEK3HE/XfrVtP3D8yMwrSHqOujV8SZlAUvjnn llY2On8IzlFHLVXPndrsdrXmyYfeqEAkFS/EJ0QzKLu7SZh0OhzYMH7y7b+jJPjmGXKs aPqg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LpWpNyXg; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47074-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47074-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWq5bU8feZ/d/4WjC2X2n/542ofsz3TXeHecB9FgoarB133L/qzFuQ72u/fWL9gt+VM6CY4hdeBKWjsbrG2HtolX3Qrdw== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id qc22-20020a170906d8b600b00a3588ab319csi4053485ejb.697.2024.01.31.12.28.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 12:28:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47074-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LpWpNyXg; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47074-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47074-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 891A91F27BAC for ; Wed, 31 Jan 2024 20:28:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66E8613EFE8; Wed, 31 Jan 2024 20:24:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LpWpNyXg" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8C35A5C5E3; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; cv=none; b=U48ttUFU9lZbBY9I/daRU2rnS+1jcj6LY0GKaK9D6HJgfLAKQ9kj8bcg38D3iIty/rmIZ3xMk3enh7OkL8hvD1zaWVjl8RmsY7qvtxe0vGzcTt6CAnQ1uzy7efuU9OHpwuLACWSAAC68/Upg0iRh1WcqbTqOreM5JYKhBnKWzWg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; c=relaxed/simple; bh=ougBeYt6zdCfhQV27TBzSU+Hnds2zUx3wZiZDbZ9RF4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=g2A+2P0X0J93Grpq3Vr87phitkxMkFMwpbClxAHOWsr5Abs1qDB7FEkMmecovKxkDo7SrxJtcpmFssoMZgxKD4UGXNsQtyvvBcrPqZdaazW3/Ug9lKXBRz4AISQpTVhB5zFDEmEpCl/sZDAc2SKwDVyODamnCGqIIRkrn+kIXzA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LpWpNyXg; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 351E1C4167E; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706732649; bh=ougBeYt6zdCfhQV27TBzSU+Hnds2zUx3wZiZDbZ9RF4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=LpWpNyXgrA5Y/VwmEXohXMT2FVnx0fpJArCLuYYrbL7iCwpCgJ+J9FYanQT2cZ29G 1rGa8LqAhk1VxlJxH2gg1aGunSiD2vKuhMbxW6JsxTyW/4dz06GGENAYOVP/b/QXV1 IBywaHsbpttMoT9tehxGz60d2r3NWIqsXauukTsP0UQmdlT4S8z1UF40ijeG484YuY F+5s4sckpoX+Yqd4lI2kFop/tQTelVHTGZqPf+keC7WeHdlgjJcRe0hgYm0huDXjml KUTbFowVRDIaZ8YpMoNSASOADVt+IDR9QRyXj33P/rRoSo+Nj0nrwvV3y6D8l+sFDC aOcfVIbHOtNfA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24F70C47258; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) From: Valentin Obst via B4 Relay Date: Wed, 31 Jan 2024 21:23:33 +0100 Subject: [PATCH v3 11/12] rust: kernel: remove unneeded doclink targets Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240131-doc-fixes-v3-v3-11-0c8af94ed7de@valentinobst.de> References: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> In-Reply-To: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Valentin Obst , Trevor Gross , Martin Rodriguez Reboredo X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706732646; l=2616; i=kernel@valentinobst.de; s=20240131; h=from:subject:message-id; bh=BwWMsMRSeC1kKnnmhQv6fYuKaj3M32UFlVEb1WuNzkc=; b=wGvATBsFaAo4TY5WjEUO/KspVCL0ZjLBOnY1oLObO9aK45Ya/Q4PX1qIKBNDOAs/Gdt0eTaX4 wkWoULzhHoiBhoqQzhNokpuv3kiGrC+SwHm+BrqDtAZihlX+0ppEWpR X-Developer-Key: i=kernel@valentinobst.de; a=ed25519; pk=3s7U8y0mqkaiurgHSQQTYWOo2tw5HgzCg5vnJVfw37Y= X-Endpoint-Received: by B4 Relay for kernel@valentinobst.de/20240131 with auth_id=124 X-Original-From: Valentin Obst Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789639197718736529 X-GMAIL-MSGID: 1789639197718736529 From: Valentin Obst Remove explicit targets for doclinks in cases where rustdoc can determine the correct target by itself. The goal is to reduce unneeded verbosity in the source code. Signed-off-by: Valentin Obst Reviewed-by: Trevor Gross Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Alice Ryhl --- rust/kernel/workqueue.rs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/rust/kernel/workqueue.rs b/rust/kernel/workqueue.rs index ed3af3491b47..73d6fa544ca6 100644 --- a/rust/kernel/workqueue.rs +++ b/rust/kernel/workqueue.rs @@ -426,13 +426,10 @@ pub unsafe fn raw_get(ptr: *const Self) -> *mut bindings::work_struct { /// The [`OFFSET`] constant must be the offset of a field in `Self` of type [`Work`]. The /// methods on this trait must have exactly the behavior that the definitions given below have. /// -/// [`Work`]: Work /// [`impl_has_work!`]: crate::impl_has_work /// [`OFFSET`]: HasWork::OFFSET pub unsafe trait HasWork { /// The offset of the [`Work`] field. - /// - /// [`Work`]: Work const OFFSET: usize; /// Returns the offset of the [`Work`] field. @@ -440,7 +437,6 @@ pub unsafe trait HasWork { /// This method exists because the [`OFFSET`] constant cannot be accessed if the type is not /// [`Sized`]. /// - /// [`Work`]: Work /// [`OFFSET`]: HasWork::OFFSET #[inline] fn get_work_offset(&self) -> usize { @@ -452,8 +448,6 @@ fn get_work_offset(&self) -> usize { /// # Safety /// /// The provided pointer must point at a valid struct of type `Self`. - /// - /// [`Work`]: Work #[inline] unsafe fn raw_get_work(ptr: *mut Self) -> *mut Work { // SAFETY: The caller promises that the pointer is valid. @@ -465,8 +459,6 @@ unsafe fn raw_get_work(ptr: *mut Self) -> *mut Work { /// # Safety /// /// The pointer must point at a [`Work`] field in a struct of type `Self`. - /// - /// [`Work`]: Work #[inline] unsafe fn work_container_of(ptr: *mut Work) -> *mut Self where @@ -495,8 +487,6 @@ unsafe fn work_container_of(ptr: *mut Work) -> *mut Self /// impl HasWork for MyStruct { self.work_field } /// } /// ``` -/// -/// [`HasWork`]: HasWork #[macro_export] macro_rules! impl_has_work { ($(impl$(<$($implarg:ident),*>)? From patchwork Wed Jan 31 20:23:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Obst via B4 Relay X-Patchwork-Id: 194927 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp4518dyc; Wed, 31 Jan 2024 12:28:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IFMSjSUrtOnxBNY75sxWEYGuRehORKfuTcov7SbsjK1Y0nKWVv5dKnNyH2uW7zBerrQVqat X-Received: by 2002:a05:622a:1304:b0:42a:ad44:22b0 with SMTP id v4-20020a05622a130400b0042aad4422b0mr5598375qtk.3.1706732936656; Wed, 31 Jan 2024 12:28:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706732936; cv=pass; d=google.com; s=arc-20160816; b=YgafNAj7K+vLPcP+DNYYERSmmgBMYDqHYYDEqwxF8VAXt5+k42utjcnpBWUfc59iRJ mBS0KyToeIGlx+bdUkjZG/d5sK6xKZLyGtfmx6xsfd2UjQtXL6UVI/i3Q8SyIT0LPz9q RCw6ODLPNTqGP+Z2lBM58ymCR26wJptmmYo/MU/LZUkML8pKZSRktDuVg8RgokgIjYzi KHJo84WsZqwICVVixB05T1DvbDe1X5mHVqLNwb98uvywyWFApLevjzTzkGWzga5cEZWY 6cFldN8Ch5CWEWSKIUli61OnPodi85oQ+LFuco5NCpMRIXj+rGyANITcjeVCuwGb8RoK Cu3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=GWSzQBCSeP76vvgq66i0aev7nX0zAQgicULAN6iChvQ=; fh=pnKxETUId2oPKBS0Qw1RnThJaXF0XpTUY9Xtgu1jxl4=; b=m166QQ4LGFHeQHx8S7AZhhY6L+PWHzxG1enNYWzuGA39F4oY2TetZh7+ACI5kzrmxz 3T+yVJ9e3TnLG8pQqS/SlMtOCVk7hd87NNhF7ZPsSZfHJOl/VozTHwKSw+EaDHajwUpM e9BNlv6hb4jiYa9/irHAb6MI/HaE1UD0VFn/Ywsnrw1REczKomN5urhNLwrhAZZ2M9Vw FFV31bc4n33CUQdwS2U0byG+kjmOvQ4I9SZKQLtEhGE7Kw9Crvv2y4DL2oB5UpipFsKd DqoF5VjGfyxU5rj57Eq8oXkW8duX/ZqncgYSUcxILGMgxwZ22C1oN6oHpi1IYqc04N/I 2PPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JBfhkEnS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47076-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47076-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCW4qEFYHbbDfYStKwzZ0gZ26IsYnl7qHTTeq2hY3nSivwd0XkXed/8GIM0YMyg8ou++Q63zKoUJG0Vk9q67pNi41f+mCQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u20-20020a05622a14d400b0042aa6c11445si7081391qtx.79.2024.01.31.12.28.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 12:28:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47076-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JBfhkEnS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47076-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47076-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 6537A1C228F7 for ; Wed, 31 Jan 2024 20:28:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7EA3B13EFEB; Wed, 31 Jan 2024 20:24:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JBfhkEnS" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B92B778B6C; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; cv=none; b=Dqwsu62fUCz2AL5L3fWE0H8JRtH4zyk+L2Ym7i+s0/HPPQ8iQVwK6Tf/JSk+ArUk7Nijfp61WITp6nDt/ffpqK7PBnA9euyaBW2NLxAI4U9qFtYnBDeHaOXzEfeH9VOUyU/VRoZnjASycyNUS1A1JngBeIMkpeigmZ0PnOZ9LJE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; c=relaxed/simple; bh=Z6DzNv6aKwU5F0iVgt7H+eG2SqQrz3L9funW8c2FQog=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZtgOtZOJhI3/cDqy0t+OUWuudTha+rghWkg/HSoD97Wf4zuyElWlzk95fY1bRqjRYn6Rjcm7OTn32aGh1BKPtMgjwSBzDhGz4LQw7pysWavOiILw1ZIc/RaSQY5HAXGph+f21jH8ag2gwS1Hm3WySnDCOCUXONYmvAZARmURmkM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JBfhkEnS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 3ED32C433A6; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706732649; bh=Z6DzNv6aKwU5F0iVgt7H+eG2SqQrz3L9funW8c2FQog=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=JBfhkEnSHeD17O6buGBZ8K+MTzx7xslYy0BFyd0LmELLO60pOr1ISHbdm5AXXlj1d +Y63vuak+bLpi3T4ykduf4l1sBSLlKXaQ0Myzfvsxb3wUvRwbioSQU6MTvKuU1EtpQ jRE5jm0Cns/wtGT4eButGtSQmiojaH4B6U17FsCDjmi4rQ/I6V4rmJvUIz5iBGYLTs UPwQGuHcqwdo3wbIpP20UhlymyVIhEzD0uO3Z5RYVLvANCBjDaB2IjaVsNGhC8668H Z1ZAIScccmEwArsteApeN3mJvnWHGwmeyTVIFS9X+PgHMLZAnmS8aeVYvElXRxZ8Fv ygAWcV3NrtgSQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EC0CC4828D; Wed, 31 Jan 2024 20:24:09 +0000 (UTC) From: Valentin Obst via B4 Relay Date: Wed, 31 Jan 2024 21:23:34 +0100 Subject: [PATCH v3 12/12] rust: locked_by: shorten doclink preview Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240131-doc-fixes-v3-v3-12-0c8af94ed7de@valentinobst.de> References: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> In-Reply-To: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Valentin Obst , Trevor Gross , Martin Rodriguez Reboredo X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706732646; l=1666; i=kernel@valentinobst.de; s=20240131; h=from:subject:message-id; bh=sqg0B5Wr1bFP5Krb6u5ZgMS6Wtgf+9jYvaOmeO5jfXs=; b=lQBqbaRJYx0+ptyykohvXQroXhFbdrLF8+38IIQ+Mrgzdcc4iQGLoNEXfOVgcOP4WxwiMVtZ7 lHRemgJ/QGwD5JvssVna2L6r4kIbhLvEGdxnqRbd19Zmt64CVD0tjKM X-Developer-Key: i=kernel@valentinobst.de; a=ed25519; pk=3s7U8y0mqkaiurgHSQQTYWOo2tw5HgzCg5vnJVfw37Y= X-Endpoint-Received: by B4 Relay for kernel@valentinobst.de/20240131 with auth_id=124 X-Original-From: Valentin Obst Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789639195648055681 X-GMAIL-MSGID: 1789639195648055681 From: Valentin Obst Increases readability by removing `super::` from the link preview text. Signed-off-by: Valentin Obst Reviewed-by: Trevor Gross Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Alice Ryhl --- rust/kernel/sync/locked_by.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rust/kernel/sync/locked_by.rs b/rust/kernel/sync/locked_by.rs index b17ee5cd98f3..babc731bd5f6 100644 --- a/rust/kernel/sync/locked_by.rs +++ b/rust/kernel/sync/locked_by.rs @@ -9,14 +9,17 @@ /// 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 -/// possible. For example, if a container has a lock and some data in the contained elements needs +/// [`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. /// /// [`LockedBy`] wraps the data in lieu of another locking primitive, and only allows access to it /// 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