Re: [PATCH] rust: Fix build error

From: Miguel Ojeda
Date: Mon Oct 14 2024 - 16:39:15 EST


On Mon, Oct 14, 2024 at 9:54 PM Eder Zulian <ezulian@xxxxxxxxxx> wrote:
>
> Error observed while building a rt-debug kernel for aarch64.

Thanks for testing with Rust enabled!

> Suggested-by: Clark Williams <williams@xxxxxxxxxx>

Do you mean `Reported-by`?

Also, I am not sure which `Fixes:` tag would fit best here, since
`PREEMPT_RT` has been around for quite a while, but only enabled very
recently. Thomas: do you have a preference?

In addition (sorry, it was in my backlog):

Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202409251238.vetlgXE9-lkp@xxxxxxxxx/

Finally, I think we should perhaps put a helper in `spinlock{_,rt}.h`
that takes the `key` (instead of having this `#ifdef` here) and then
just use that from the Rust helpers, because we don't want to
duplicate such logic (conditionals) in helpers. And with the RT init
open coding that Boqun mentioned, even more. After all, helpers are
meant to be as straightforward as possible, and if we have this sort
of thing in helpers, it is harder for everyone to keep them in sync.

In other words, I see helpers as following the same "avoid `#ifdef`s"
rule that we prefer in C source files vs. headers.

What do you think, Thomas?

>

Spurious newline.

Cheers,
Miguel