Skip to contentSkip to conversation

rust: clean and enable Clippy `doc_markdown` lint

PATCH Applied Miguel Ojeda 6 participants 24 messages Mar 24, 2025 – May 25, 2025

Subsystems (10)
DRM drivers DRM misc Kbuild PCI +6 more subsystems
lore
Share & tools
lore

Miguel Ojeda

author maintainer
#0 lore raw

cover rust: clean and enable Clippy `doc_markdown` lint

This is how it would look like -- I am not sure how many false positives we will get, so I marked the last commit as RFC and perhaps we just want this lint as an opt-in in e.g. W=2.

However, so far, we only got one ("KUnit"), plus a couple others that are in C side comments that were copied, and thus someone may want to keep them exactly in sync. So it seems pretty OK so far.

Another question is whether we want to commit to something like the global list in .clippy.toml.

Anyway, please take a look -- the other commits should probably be picked even if we do not enable the lint.

Thanks!

Miguel Ojeda (10):
drm/panic: add missing space
drm/panic: add missing Markdown code span
rust: alloc: add missing Markdown code spans
rust: alloc: add missing Markdown code span
rust: dma: add missing Markdown code span
rust: of: add missing Markdown code span
rust: pci: fix docs related to missing Markdown code spans
rust: platform: fix docs related to missing Markdown code spans
rust: task: add missing Markdown code spans and intra-doc links
rust: kbuild: enable doc_markdown Clippy lint

 .clippy.toml                        |  4 ++++
 Makefile                            |  1 +
 drivers/gpu/drm/drm_panic_qr.rs     |  4 ++--
 rust/kernel/alloc.rs                |  4 ++--
 rust/kernel/alloc/allocator_test.rs |  2 +-
 rust/kernel/dma.rs                  |  2 +-
 rust/kernel/of.rs                   |  2 +-
 rust/kernel/pci.rs                  | 15 +++++++++------
 rust/kernel/platform.rs             |  9 +++++----
 rust/kernel/task.rs                 |  4 ++--
 10 files changed, 28 insertions(+), 19 deletions(-)

--
2.49.0

author maintainer
#1 lore raw

PATCH 1/10 drm/panic: add missing space

Add missing space in sentence.

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

Fixes cb5164ac43d0 ("drm/panic: Add a QR code panic screen")
---
 drivers/gpu/drm/drm_panic_qr.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_panic_qr.rs +1 -1
index ecd87e8ffe05..9bd4d131f033 100644
@@ -5,7 +5,7 @@
 //! It is called from a panic handler, so it should't allocate memory and
 //! does all the work on the stack or on the provided buffers. For
 //! simplification, it only supports low error correction, and applies the
-//! first mask (checkerboard). It will draw the smallest QRcode that can
+//! first mask (checkerboard). It will draw the smallest QR code that can
 //! contain the string passed as parameter. To get the most compact
 //! QR code, the start of the URL is encoded as binary, and the
 //! compressed kmsg is encoded as numeric.
Signature · 1 line
2.49.0
Reviewed-by on v1 1/10
#2 lore raw

Re: [PATCH 01/10] drm/panic: add missing space

Quoted 4 lines · Miguel Ojeda

Add missing space in sentence.

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

Thanks, it looks good to me.

Quoted 20 lines
Fixes cb5164ac43d0 ("drm/panic: Add a QR code panic screen")
---
  drivers/gpu/drm/drm_panic_qr.rs | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_panic_qr.rs +1 -1
index ecd87e8ffe05..9bd4d131f033 100644
@@ -5,7 +5,7 @@
  //! It is called from a panic handler, so it should't allocate memory and
  //! does all the work on the stack or on the provided buffers. For
  //! simplification, it only supports low error correction, and applies the
-//! first mask (checkerboard). It will draw the smallest QRcode that can
+//! first mask (checkerboard). It will draw the smallest QR code that can
  //! contain the string passed as parameter. To get the most compact
  //! QR code, the start of the URL is encoded as binary, and the
  //! compressed kmsg is encoded as numeric.
author maintainer
#3 lore raw

PATCH 2/10 drm/panic: add missing Markdown code span

In reply to Miguel Ojeda

Add missing Markdown code span.

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

Fixes cb5164ac43d0 ("drm/panic: Add a QR code panic screen")
---
 drivers/gpu/drm/drm_panic_qr.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_panic_qr.rs +1 -1
index 9bd4d131f033..a8f832598c70 100644
@@ -914,7 +914,7 @@ fn draw_all(&mut self, data: impl Iterator<Item = u8>) {
 ///    will be encoded as binary segment, otherwise it will be encoded
 ///    efficiently as a numeric segment, and appended to the URL.
 /// * `data_len`: Length of the data, that needs to be encoded, must be less
-///    than data_size.
+///    than `data_size`.
 /// * `data_size`: Size of data buffer, it should be at least 4071 bytes to hold
 ///    a V40 QR code. It will then be overwritten with the QR code image.
 /// * `tmp`: A temporary buffer that the QR code encoder will use, to write the
Signature · 1 line
2.49.0
Reviewed-by on v1 2/10
#4 lore raw

Re: [PATCH 02/10] drm/panic: add missing Markdown code span

Quoted 4 lines · Miguel Ojeda

Add missing Markdown code span.

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

Thanks, it looks good to me.

You want to take the whole series in the rust tree?

Otherwise I can push the patch 1-2 to drm-misc-next if needed.

Signature · 1 line
Jocelyn
Quoted 20 lines
Fixes cb5164ac43d0 ("drm/panic: Add a QR code panic screen")
---
  drivers/gpu/drm/drm_panic_qr.rs | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_panic_qr.rs +1 -1
index 9bd4d131f033..a8f832598c70 100644
@@ -914,7 +914,7 @@ fn draw_all(&mut self, data: impl Iterator<Item = u8>) {
  ///    will be encoded as binary segment, otherwise it will be encoded
  ///    efficiently as a numeric segment, and appended to the URL.
  /// * `data_len`: Length of the data, that needs to be encoded, must be less
-///    than data_size.
+///    than `data_size`.
  /// * `data_size`: Size of data buffer, it should be at least 4071 bytes to hold
  ///    a V40 QR code. It will then be overwritten with the QR code image.
  /// * `tmp`: A temporary buffer that the QR code encoder will use, to write the
#5 lore raw

Re: [PATCH 02/10] drm/panic: add missing Markdown code span

Quoted 8 lines · Jocelyn Falempe

Thanks, it looks good to me.

You want to take the whole series in the rust tree?

Otherwise I can push the patch 1-2 to drm-misc-next if needed.

Please take them if possible, since others may want to take them through their tree anyway, plus it should have less conflicts if you change other bits, plus these are independent fixes anyway that can go in on their own whether or not the lint gets eventually enabled.

Thanks!

Cheers,
Miguel

#6 lore raw

Re: [PATCH 02/10] drm/panic: add missing Markdown code span

Quoted 6 lines · Miguel Ojeda
Quoted 5 lines · Jocelyn Falempe

Thanks, it looks good to me.

Quoted 8 lines
Quoted 3 lines

You want to take the whole series in the rust tree?

Otherwise I can push the patch 1-2 to drm-misc-next if needed.

Please take them if possible, since others may want to take them through their tree anyway, plus it should have less conflicts if you change other bits, plus these are independent fixes anyway that can go in on their own whether or not the lint gets eventually enabled.

I just pushed 1-2 to drm-misc-next

Thanks,

Signature · 1 line
Jocelyn
Quoted 6 lines

Thanks!

Cheers,
Miguel

author maintainer
#7 lore raw

PATCH 3/10 rust: alloc: add missing Markdown code spans

In reply to Miguel Ojeda

Add missing Markdown code spans.

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

Fixes b6a006e21b82 ("rust: alloc: introduce allocation flags")
---
 rust/kernel/alloc.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
rust/kernel/alloc.rs +2 -2
index fc9c9c41cd79..a2c49e5494d3 100644
@@ -94,10 +94,10 @@ pub mod flags {
     ///
     /// A lower watermark is applied to allow access to "atomic reserves". The current
     /// implementation doesn't support NMI and few other strict non-preemptive contexts (e.g.
-    /// raw_spin_lock). The same applies to [`GFP_NOWAIT`].
+    /// `raw_spin_lock`). The same applies to [`GFP_NOWAIT`].
     pub const GFP_ATOMIC: Flags = Flags(bindings::GFP_ATOMIC);
 
-    /// Typical for kernel-internal allocations. The caller requires ZONE_NORMAL or a lower zone
+    /// Typical for kernel-internal allocations. The caller requires `ZONE_NORMAL` or a lower zone
     /// for direct access but can direct reclaim.
     pub const GFP_KERNEL: Flags = Flags(bindings::GFP_KERNEL);
 
Signature · 1 line
2.49.0
author maintainer
#8 lore raw

PATCH 4/10 rust: alloc: add missing Markdown code span

In reply to Miguel Ojeda

Add missing Markdown code span.

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

Fixes dd09538fb409 ("rust: alloc: implement `Cmalloc` in module allocator_test")
---
 rust/kernel/alloc/allocator_test.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/alloc/allocator_test.rs +1 -1
index e3240d16040b..039cd1e36c21 100644
@@ -4,7 +4,7 @@
 //! of those types (e.g. `CString`) use kernel allocators for instantiation.
 //!
 //! In order to allow userspace test cases to make use of such types as well, implement the
-//! `Cmalloc` allocator within the allocator_test module and type alias all kernel allocators to
+//! `Cmalloc` allocator within the `allocator_test` module and type alias all kernel allocators to
 //! `Cmalloc`. The `Cmalloc` allocator uses libc's `realloc()` function as allocator backend.
 
 #![allow(missing_docs)]
Signature · 1 line
2.49.0
author maintainer
#9 lore raw

PATCH 5/10 rust: dma: add missing Markdown code span

In reply to Miguel Ojeda

Add missing Markdown code span.

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

Fixes ad2907b4e308 ("rust: add dma coherent allocator abstraction")
---
 rust/kernel/dma.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/dma.rs +1 -1
index 8cdc76043ee7..35fd8a638473 100644
@@ -94,7 +94,7 @@ pub mod attrs {
     pub const DMA_ATTR_ALLOC_SINGLE_PAGES: Attrs = Attrs(bindings::DMA_ATTR_ALLOC_SINGLE_PAGES);
 
     /// This tells the DMA-mapping subsystem to suppress allocation failure reports (similarly to
-    /// __GFP_NOWARN).
+    /// `__GFP_NOWARN`).
     pub const DMA_ATTR_NO_WARN: Attrs = Attrs(bindings::DMA_ATTR_NO_WARN);
 
     /// Used to indicate that the buffer is fully accessible at an elevated privilege level (and
Signature · 1 line
2.49.0
author maintainer
#10 lore raw

PATCH 6/10 rust: of: add missing Markdown code span

In reply to Miguel Ojeda

Add missing Markdown code span.

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

Fixes bbe3b4d1580d ("rust: of: add `of::DeviceId` abstraction")
---
 rust/kernel/of.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/of.rs +1 -1
index 04f2d8ef29cb..60ed551b50fb 100644
@@ -4,7 +4,7 @@
 
 use crate::{bindings, device_id::RawDeviceId, prelude::*};
 
-/// IdTable type for OF drivers.
+/// `IdTable` type for OF drivers.
 pub type IdTable<T> = &'static dyn kernel::device_id::IdTable<DeviceId, T>;
 
 /// An open firmware device id.
Signature · 1 line
2.49.0
author maintainer
#11 lore raw

PATCH 7/10 rust: pci: fix docs related to missing Markdown code spans

In reply to Miguel Ojeda

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")
---
 rust/kernel/pci.rs | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
rust/kernel/pci.rs +9 -6
index f7b2743828ae..99413607c2b6 100644
@@ -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

#12 lore raw

Re: [PATCH 07/10] rust: pci: fix docs related to missing Markdown code spans

rust/kernel/pci.rs macro_rules! module_pci_driver { · line 118

Quoted 10 lines · Miguel Ojeda
rust/kernel/pci.rs +1 -1
index f7b2743828ae..99413607c2b6 100644
@@ -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`]).

Wouldn't "([struct pci_device_id])" make more sense?

---
Cheers,
Benno

Quoted 5 lines
rust/kernel/pci.rs +2 -0
+///
+/// [`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);
#13 lore raw

Re: [PATCH 07/10] rust: pci: fix docs related to missing Markdown code spans

Quoted 2 lines · Benno Lossin

Wouldn't "([struct pci_device_id])" make more sense?

Yeah, definitely, it should have the struct to be consistent with our usual style.

Cheers,
Miguel

author maintainer
#14 lore raw

PATCH 8/10 rust: platform: fix docs related to missing Markdown code spans

In reply to Miguel Ojeda

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 683a63befc73 ("rust: platform: add basic platform device / driver abstractions")
---
 rust/kernel/platform.rs | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
rust/kernel/platform.rs +5 -4
index 1297f5292ba9..2426eaf915bb 100644
@@ -147,10 +147,11 @@ macro_rules! module_platform_driver {
 ///```
 pub trait Driver {
     /// The type holding driver private data 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 OF device ids supported by the driver.

--
2.49.0

author maintainer
#15 lore raw

PATCH 9/10 rust: task: add missing Markdown code spans and intra-doc links

In reply to Miguel Ojeda

Add missing Markdown code spans and also convert them into intra-doc links.

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

Fixes e0020ba6cbcb ("rust: add PidNamespace")
---
 rust/kernel/task.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
rust/kernel/task.rs +2 -2
index 49012e711942..ca1209b997c4 100644
@@ -156,10 +156,10 @@ fn deref(&self) -> &Self::Target {
         }
     }
 
-    /// Returns a PidNamespace reference for the currently executing task's/thread's pid namespace.
+    /// Returns a [`PidNamespace`] reference for the currently executing task's/thread's pid namespace.
     ///
     /// This function can be used to create an unbounded lifetime by e.g., storing the returned
-    /// PidNamespace in a global variable which would be a bug. So the recommended way to get the
+    /// [`PidNamespace`] in a global variable which would be a bug. So the recommended way to get the
     /// current task's/thread's pid namespace is to use the [`current_pid_ns`] macro because it is
     /// safe.
     ///
Signature · 1 line
2.49.0
author maintainer
#16 lore raw

RFC PATCH 10/10 rust: kbuild: enable `doc_markdown` Clippy lint

In reply to Miguel Ojeda

Clippy supports the doc_markdown lint [1] since 2016 [2]:

Checks for the presence of _, :: or camel-case words outside ticks in documentation.

It is a very common note in Linux kernel reviews to mention that documentation is missing a Markdown code span, e.g.:

    /// Length of the data must be less than data_size.

should have been:

    /// Length of the data must be less than `data_size`.

This lint can identify some of those cases automatically for us.

It also caught for us other typos or mis-documentation, such as a missing code block.

Thus enable it, now that the tree is sufficiently clean.

Relatedly, it would be nice to have something similar [3] even for comments (not just documentation), as well as for possible intra-doc links (which should also have less false positives).

---
 .clippy.toml | 4 ++++
 Makefile     | 1 +
 2 files changed, 5 insertions(+)
.clippy.toml +4 -0
index 815c94732ed7..adc32c88176c 100644
@@ -9,3 +9,7 @@ disallowed-macros = [
     # it here, see: https://github.com/rust-lang/rust-clippy/issues/11303.
     { path = "kernel::dbg", reason = "the `dbg!` macro is intended as a debugging tool" },
 ]
+
+doc-valid-idents = [
+    "KUnit",
+]
Makefile +1 -0
index 70bdbf2218fc..5d6baedc097f 100644
@@ -477,6 +477,7 @@ export rust_common_flags := --edition=2021 \
 			    -Wrust_2018_idioms \
 			    -Wunreachable_pub \
 			    -Wclippy::all \
+			    -Wclippy::doc_markdown \
 			    -Wclippy::ignored_unit_patterns \
 			    -Wclippy::mut_mut \
 			    -Wclippy::needless_bitwise_bool \

--
2.49.0

Reviewed-by on the v1 series
#17 lore raw
In reply to Miguel Ojeda
Quoted 3 lines · Miguel Ojeda

This is how it would look like -- I am not sure how many false positives we will get, so I marked the last commit as RFC and perhaps we just want this lint as an opt-in in e.g. W=2.

I think we should try. If it's too much trouble, we can disable it again.

Quoted 6 lines

However, so far, we only got one ("KUnit"), plus a couple others that are in C side comments that were copied, and thus someone may want to keep them exactly in sync. So it seems pretty OK so far.

Another question is whether we want to commit to something like the global list in .clippy.toml.

Not sure what you mean by this, but I think we need some way to disable it for some acronyms.

Quoted 2 lines

Anyway, please take a look -- the other commits should probably be picked even if we do not enable the lint.

For the entire series:

---
Cheers,
Benno

Quoted 28 lines

Thanks!

Miguel Ojeda (10):
drm/panic: add missing space
drm/panic: add missing Markdown code span
rust: alloc: add missing Markdown code spans
rust: alloc: add missing Markdown code span
rust: dma: add missing Markdown code span
rust: of: add missing Markdown code span
rust: pci: fix docs related to missing Markdown code spans
rust: platform: fix docs related to missing Markdown code spans
rust: task: add missing Markdown code spans and intra-doc links
rust: kbuild: enable doc_markdown Clippy lint

 .clippy.toml                        |  4 ++++
 Makefile                            |  1 +
 drivers/gpu/drm/drm_panic_qr.rs     |  4 ++--
 rust/kernel/alloc.rs                |  4 ++--
 rust/kernel/alloc/allocator_test.rs |  2 +-
 rust/kernel/dma.rs                  |  2 +-
 rust/kernel/of.rs                   |  2 +-
 rust/kernel/pci.rs                  | 15 +++++++++------
 rust/kernel/platform.rs             |  9 +++++----
 rust/kernel/task.rs                 |  4 ++--
 10 files changed, 28 insertions(+), 19 deletions(-)

--
2.49.0

#18 lore raw
Quoted 3 lines · Benno Lossin

Not sure what you mean by this, but I think we need some way to disable it for some acronyms.

I meant that maintaining the list in that file (i.e. globally) could be a bit painful if we get a lot of terms, but I guess we can find workarounds for that if it gets bad.

Quoted 1 line

Thanks!

Cheers,
Miguel

#19 lore raw
Quoted 8 lines · Miguel Ojeda
Quoted 3 lines · Benno Lossin

Not sure what you mean by this, but I think we need some way to disable it for some acronyms.

I meant that maintaining the list in that file (i.e. globally) could be a bit painful if we get a lot of terms, but I guess we can find workarounds for that if it gets bad.

I think we can just see if it's a problem. If we keep each term on its own line, merging should be easy.

---
Cheers,
Benno

#20 lore raw
In reply to Miguel Ojeda
Quoted 8 lines · Miguel Ojeda

rust: alloc: add missing Markdown code spans
rust: alloc: add missing Markdown code span
rust: dma: add missing Markdown code span
rust: of: add missing Markdown code span
rust: pci: fix docs related to missing Markdown code spans
rust: platform: fix docs related to missing Markdown code spans
rust: task: add missing Markdown code spans and intra-doc links

Abdiel, Danilo, Rob, Saravana, Greg, Rafael: anything against me picking these ones up?

If you would like to pick them up through your respective trees, then that is great too.

Thanks!

Cheers,
Miguel

maintainer Acked-by
#21 lore raw
Quoted 10 lines · Miguel Ojeda
Quoted 8 lines · Miguel Ojeda

rust: alloc: add missing Markdown code spans
rust: alloc: add missing Markdown code span
rust: dma: add missing Markdown code span
rust: of: add missing Markdown code span
rust: pci: fix docs related to missing Markdown code spans
rust: platform: fix docs related to missing Markdown code spans
rust: task: add missing Markdown code spans and intra-doc links

Quoted 2 lines

Abdiel, Danilo, Rob, Saravana, Greg, Rafael: anything against me picking these ones up?

No objection from me for you to take these through the rust tree:

maintainer Acked-by
#22 lore raw
In reply to Miguel Ojeda
Quoted 10 lines · Miguel Ojeda
Quoted 8 lines · Miguel Ojeda

rust: alloc: add missing Markdown code spans
rust: alloc: add missing Markdown code span
rust: dma: add missing Markdown code span
rust: of: add missing Markdown code span
rust: pci: fix docs related to missing Markdown code spans
rust: platform: fix docs related to missing Markdown code spans
rust: task: add missing Markdown code spans and intra-doc links

Quoted 2 lines

Abdiel, Danilo, Rob, Saravana, Greg, Rafael: anything against me picking these ones up?

Applied
#23 lore raw
In reply to Miguel Ojeda
Quoted 7 lines · Miguel Ojeda

rust: alloc: add missing Markdown code spans
rust: alloc: add missing Markdown code span
rust: dma: add missing Markdown code span
rust: pci: fix docs related to missing Markdown code spans
rust: platform: fix docs related to missing Markdown code spans
rust: task: add missing Markdown code spans and intra-doc links

Applied to rust-next-- thanks everyone!

I picked the ones Acked by Greg and Danilo (thanks!), plus Jocelyn picked the drm/panic ones a while ago. So now only the of one is pending, but there are new cases coming, so I may send another version of the series to clean them and possibly enable the lint.

Cheers,
Miguel