Re: [PATCH v7 3/6] rust: irq: add support for non-threaded IRQs and handlers

From: Alice Ryhl
Date: Mon Jul 21 2025 - 10:17:58 EST


On Thu, Jul 17, 2025 at 6:21 PM Daniel Almeida
<daniel.almeida@xxxxxxxxxxxxx> wrote:
>
>
>
> > On 16 Jul 2025, at 20:45, kernel test robot <lkp@xxxxxxxxx> wrote:
> >
> > Hi Daniel,
> >
> > kernel test robot noticed the following build errors:
> >
> > [auto build test ERROR on 3964d07dd821efe9680e90c51c86661a98e60a0f]
> >
> > url: https://github.com/intel-lab-lkp/linux/commits/Daniel-Almeida/rust-irq-add-irq-module/20250715-232121
> > base: 3964d07dd821efe9680e90c51c86661a98e60a0f
> > patch link: https://lore.kernel.org/r/20250715-topics-tyr-request_irq2-v7-3-d469c0f37c07%40collabora.com
> > patch subject: [PATCH v7 3/6] rust: irq: add support for non-threaded IRQs and handlers
> > config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250717/202507170718.AVqYqRan-lkp@xxxxxxxxx/config)
> > compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> > rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250717/202507170718.AVqYqRan-lkp@xxxxxxxxx/reproduce)
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202507170718.AVqYqRan-lkp@xxxxxxxxx/
> >
> > All errors (new ones prefixed by >>):
> >
> >>> error[E0425]: cannot find value `SHARED` in module `flags`
> > --> rust/doctests_kernel_generated.rs:4790:58
> > |
> > 4790 | let registration = Registration::new(request, flags::SHARED, c_str!("my_device"), handler);
> > | ^^^^^^ not found in `flags`
> > |
> > help: consider importing this constant
> > |
> > 3 + use kernel::mm::virt::flags::SHARED;
> > |
> > help: if you import `SHARED`, refer to it directly
> > |
> > 4790 - let registration = Registration::new(request, flags::SHARED, c_str!("my_device"), handler);
> > 4790 + let registration = Registration::new(request, SHARED, c_str!("my_device"), handler);
> > |
> >
> > --
> > 0-DAY CI Kernel Test Service
> > https://github.com/intel/lkp-tests/wiki
> >
>
> This is a single character fix, so I am waiting for the discussion on the cover
> letter [0] to advance before sending a new version.
>
> [0] https://lore.kernel.org/all/DBCQKJIBVGGM.1R0QNKO3TE4N0@xxxxxxxxxx/#t

My suggestion is to make the flags module private and re-export the
Flags type from the irq module. That way you don't have to write
use kernel::irq::flags::Flags;

Alice