Commit b6985083 authored by Viresh Kumar's avatar Viresh Kumar Committed by Miguel Ojeda
Browse files

rust: Use consistent "# Examples" heading style in rustdoc



Use a consistent `# Examples` heading in rustdoc across the codebase.

Some modules previously used `## Examples` (even when they should be
available as top-level headers), while others used `# Example`, which
deviates from the preferred `# Examples` style.

Suggested-by: default avatarMiguel Ojeda <ojeda@kernel.org>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Acked-by: default avatarBenno Lossin <lossin@kernel.org>
Link: https://lore.kernel.org/r/ddd5ce0ac20c99a72a4f1e4322d3de3911056922.1749545815.git.viresh.kumar@linaro.org


Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent bfb9e46b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@
//! [`GenDiskBuilder`]: gen_disk::GenDiskBuilder
//! [`GenDiskBuilder::build`]: gen_disk::GenDiskBuilder::build
//!
//! # Example
//! # Examples
//!
//! ```rust
//! use kernel::{
+3 −3
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
///
/// Represents a frequency in hertz, wrapping a [`c_ulong`] value.
///
/// ## Examples
/// # Examples
///
/// ```
/// use kernel::clk::Hertz;
@@ -95,7 +95,7 @@ mod common_clk {
    /// Instances of this type are reference-counted. Calling [`Clk::get`] ensures that the
    /// allocation remains valid for the lifetime of the [`Clk`].
    ///
    /// ## Examples
    /// # Examples
    ///
    /// The following example demonstrates how to obtain and configure a clock for a device.
    ///
@@ -266,7 +266,7 @@ fn drop(&mut self) {
    /// Instances of this type are reference-counted. Calling [`OptionalClk::get`] ensures that the
    /// allocation remains valid for the lifetime of the [`OptionalClk`].
    ///
    /// ## Examples
    /// # Examples
    ///
    /// The following example demonstrates how to obtain and configure an optional clock for a
    /// device. The code functions correctly whether or not the clock is available.
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
//!
//! C header: [`include/linux/configfs.h`](srctree/include/linux/configfs.h)
//!
//! # Example
//! # Examples
//!
//! ```ignore
//! use kernel::alloc::flags;
+4 −4
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ fn from(index: TableIndex) -> Self {
/// The callers must ensure that the `struct cpufreq_frequency_table` is valid for access and
/// remains valid for the lifetime of the returned reference.
///
/// ## Examples
/// # Examples
///
/// The following example demonstrates how to read a frequency value from [`Table`].
///
@@ -318,7 +318,7 @@ fn deref(&self) -> &Self::Target {
///
/// This is used by the CPU frequency drivers to build a frequency table dynamically.
///
/// ## Examples
/// # Examples
///
/// The following example demonstrates how to create a CPU frequency table.
///
@@ -395,7 +395,7 @@ pub fn to_table(mut self) -> Result<TableBox> {
/// The callers must ensure that the `struct cpufreq_policy` is valid for access and remains valid
/// for the lifetime of the returned reference.
///
/// ## Examples
/// # Examples
///
/// The following example demonstrates how to create a CPU frequency table.
///
@@ -834,7 +834,7 @@ fn register_em(_policy: &mut Policy) {

/// CPU frequency driver Registration.
///
/// ## Examples
/// # Examples
///
/// The following example demonstrates how to register a cpufreq driver.
///
+2 −2
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@
/// The callers must ensure that the `struct cpumask` is valid for access and
/// remains valid for the lifetime of the returned reference.
///
/// ## Examples
/// # Examples
///
/// The following example demonstrates how to update a [`Cpumask`].
///
@@ -175,7 +175,7 @@ pub fn copy(&self, dstp: &mut Self) {
/// The callers must ensure that the `struct cpumask_var_t` is valid for access and remains valid
/// for the lifetime of [`CpumaskVar`].
///
/// ## Examples
/// # Examples
///
/// The following example demonstrates how to create and update a [`CpumaskVar`].
///
Loading