Skip to content

Commit 21d8a68

Browse files
vireshkrafaeljw
authored andcommitted
rust: opp: Make the doctest example depend on CONFIG_OF
The doctest example uses a function only available for CONFIG_OF and so the build with doc tests fails when it isn't enabled. error[E0599]: no function or associated item named `from_of_cpumask` found for struct `rust_doctest_kernel_alloc_kbox_rs_4::kernel::opp::Table` in the current scope Fix this by making the doctest depend on CONFIG_OF. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202505260856.ZQWHW2xT-lkp@intel.com/ Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Link: https://patch.msgid.link/a80bfedcb4d94531dc27d3b48062db5042078e88.1748237646.git.viresh.kumar@linaro.org Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 0c905ca commit 21d8a68

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

rust/kernel/opp.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ impl<T: ConfigOps + Default> Config<T> {
582582
/// use kernel::opp::Table;
583583
/// use kernel::types::ARef;
584584
///
585+
/// #[cfg(CONFIG_OF)]
585586
/// fn get_table(dev: &ARef<Device>, mask: &mut Cpumask, freq: Hertz) -> Result<Table> {
586587
/// let mut opp_table = Table::from_of_cpumask(dev, mask)?;
587588
///

0 commit comments

Comments
 (0)