Skip to content

Commit 1dbaf8b

Browse files
committed
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: 1bd8b6b ("rust: pci: add basic PCI device / driver abstractions") Reviewed-by: Benno Lossin <[email protected]> Acked-by: Danilo Krummrich <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Prefixed link text with `struct`. - Miguel ] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent abd21a1 commit 1dbaf8b

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

rust/kernel/pci.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ macro_rules! module_pci_driver {
118118
};
119119
}
120120

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
122124
#[repr(transparent)]
123125
#[derive(Clone, Copy)]
124126
pub struct DeviceId(bindings::pci_device_id);
@@ -173,7 +175,7 @@ unsafe impl RawDeviceId for DeviceId {
173175
}
174176
}
175177

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

179181
/// Create a PCI `IdTable` with its alias for modpost.
@@ -224,10 +226,11 @@ macro_rules! pci_device_table {
224226
/// `Adapter` documentation for an example.
225227
pub trait Driver: Send {
226228
/// The type holding information about each device id supported by the driver.
227-
///
228-
/// TODO: Use associated_type_defaults once stabilized:
229-
///
230-
/// type IdInfo: 'static = ();
229+
// TODO: Use `associated_type_defaults` once stabilized:
230+
//
231+
// ```
232+
// type IdInfo: 'static = ();
233+
// ```
231234
type IdInfo: 'static;
232235

233236
/// The table of device ids supported by the driver.

0 commit comments

Comments
 (0)