rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miguel Ojeda <ojeda@kernel.org>
To: Miguel Ojeda <ojeda@kernel.org>, Alex Gaynor <alex.gaynor@gmail.com>
Cc: "Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
	patches@lists.linux.dev, "Bjorn Helgaas" <bhelgaas@google.com>,
	"FUJITA Tomonori" <fujita.tomonori@gmail.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-pci@vger.kernel.org
Subject: [PATCH 07/10] rust: pci: fix docs related to missing Markdown code spans
Date: Mon, 24 Mar 2025 22:03:54 +0100	[thread overview]
Message-ID: <20250324210359.1199574-8-ojeda@kernel.org> (raw)
In-Reply-To: <20250324210359.1199574-1-ojeda@kernel.org>

In particular:

  - Add missing Markdown code spans.

  - Improve title for `DeviceId`, adding a link to the struct in the
    C side, rather than referring to `bindings::`.

  - Convert `TODO` from documentation to a normal comment, and put code
    in block.

This was found using the Clippy `doc_markdown` lint, which we may want
to enable.

Fixes: 1bd8b6b2c5d3 ("rust: pci: add basic PCI device / driver abstractions")
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 rust/kernel/pci.rs | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/rust/kernel/pci.rs b/rust/kernel/pci.rs
index f7b2743828ae..99413607c2b6 100644
--- a/rust/kernel/pci.rs
+++ b/rust/kernel/pci.rs
@@ -115,7 +115,9 @@ macro_rules! module_pci_driver {
 };
 }

-/// Abstraction for bindings::pci_device_id.
+/// Abstraction for the PCI device ID structure ([`pci_device_id`]).
+///
+/// [`pci_device_id`]: https://docs.kernel.org/PCI/pci.html#c.pci_device_id
 #[repr(transparent)]
 #[derive(Clone, Copy)]
 pub struct DeviceId(bindings::pci_device_id);
@@ -170,7 +172,7 @@ fn index(&self) -> usize {
     }
 }

-/// IdTable type for PCI
+/// `IdTable` type for PCI.
 pub type IdTable<T> = &'static dyn kernel::device_id::IdTable<DeviceId, T>;

 /// Create a PCI `IdTable` with its alias for modpost.
@@ -221,10 +223,11 @@ macro_rules! pci_device_table {
 /// `Adapter` documentation for an example.
 pub trait Driver {
     /// The type holding information about each device id supported by the driver.
-    ///
-    /// TODO: Use associated_type_defaults once stabilized:
-    ///
-    /// type IdInfo: 'static = ();
+    // TODO: Use `associated_type_defaults` once stabilized:
+    //
+    // ```
+    // type IdInfo: 'static = ();
+    // ```
     type IdInfo: 'static;

     /// The table of device ids supported by the driver.
--
2.49.0

  parent reply	other threads:[~2025-03-24 21:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-24 21:03 [PATCH 00/10] rust: clean and enable Clippy `doc_markdown` lint Miguel Ojeda
2025-03-24 21:03 ` [PATCH 01/10] drm/panic: add missing space Miguel Ojeda
2025-03-25  9:02   ` Jocelyn Falempe
2025-03-24 21:03 ` [PATCH 02/10] drm/panic: add missing Markdown code span Miguel Ojeda
2025-03-25  9:05   ` Jocelyn Falempe
2025-03-25 19:04     ` Miguel Ojeda
2025-03-27 15:22       ` Jocelyn Falempe
2025-03-24 21:03 ` [PATCH 03/10] rust: alloc: add missing Markdown code spans Miguel Ojeda
2025-03-24 21:03 ` [PATCH 04/10] rust: alloc: add missing Markdown code span Miguel Ojeda
2025-03-24 21:03 ` [PATCH 05/10] rust: dma: " Miguel Ojeda
2025-03-24 21:03 ` [PATCH 06/10] rust: of: " Miguel Ojeda
2025-03-24 21:03 ` Miguel Ojeda [this message]
2025-03-24 22:53   ` [PATCH 07/10] rust: pci: fix docs related to missing Markdown code spans Benno Lossin
2025-03-24 23:01     ` Miguel Ojeda
2025-03-24 21:03 ` [PATCH 08/10] rust: platform: " Miguel Ojeda
2025-03-24 21:03 ` [PATCH 09/10] rust: task: add missing Markdown code spans and intra-doc links Miguel Ojeda
2025-03-24 21:03 ` [RFC PATCH 10/10] rust: kbuild: enable `doc_markdown` Clippy lint Miguel Ojeda
2025-03-24 22:59 ` [PATCH 00/10] rust: clean and enable Clippy `doc_markdown` lint Benno Lossin
2025-03-24 23:09   ` Miguel Ojeda
2025-03-25  0:17     ` Benno Lossin
2025-05-21 14:01 ` Miguel Ojeda
2025-05-21 15:09   ` Greg Kroah-Hartman
2025-05-24 14:18   ` Danilo Krummrich
2025-05-25 21:20 ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250324210359.1199574-8-ojeda@kernel.org \
    --to=ojeda@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=fujita.tomonori@gmail.com \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).