Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: pci: fix docs related to missing Markdown code spans

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")
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20250324210359.1199574-8-ojeda@kernel.org
[ Prefixed link text with `struct`. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

+9 -6
+9 -6
rust/kernel/pci.rs
··· 118 118 }; 119 119 } 120 120 121 - /// Abstraction for bindings::pci_device_id. 121 + /// Abstraction for the PCI device ID structure ([`struct pci_device_id`]). 122 + /// 123 + /// [`struct pci_device_id`]: https://docs.kernel.org/PCI/pci.html#c.pci_device_id 122 124 #[repr(transparent)] 123 125 #[derive(Clone, Copy)] 124 126 pub struct DeviceId(bindings::pci_device_id); ··· 175 173 } 176 174 } 177 175 178 - /// IdTable type for PCI 176 + /// `IdTable` type for PCI. 179 177 pub type IdTable<T> = &'static dyn kernel::device_id::IdTable<DeviceId, T>; 180 178 181 179 /// Create a PCI `IdTable` with its alias for modpost. ··· 226 224 /// `Adapter` documentation for an example. 227 225 pub trait Driver: Send { 228 226 /// The type holding information about each device id supported by the driver. 229 - /// 230 - /// TODO: Use associated_type_defaults once stabilized: 231 - /// 232 - /// type IdInfo: 'static = (); 227 + // TODO: Use `associated_type_defaults` once stabilized: 228 + // 229 + // ``` 230 + // type IdInfo: 'static = (); 231 + // ``` 233 232 type IdInfo: 'static; 234 233 235 234 /// The table of device ids supported by the driver.