Re: linux-next: build failure after merge of the rust tree

Miguel Ojeda
2024-11-11T08:16:56Z

On Mon, Nov 11, 2024 at 7:58 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> My first rust build error! ;-)

:)

> error[E0308]: mismatched types
> --> rust/kernel/device.rs:176:17
> |
> 175 | bindings::_dev_printk(
> | --------------------- arguments to this function are incorrect
> 176 | klevel as *const _ as *const core::ffi::c_char,
> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `*const u8`, found `*const i8`
> |
> = note: expected raw pointer `*const u8`
> found raw pointer `*const i8`

Yeah, sorry about that, this had very high chances of happening. For
instance, here we would need `crate::ffi::c_char`.

I am thinking perhaps the easiest way for everyone is to take for the
moment only the patches up to introducing the new `ffi::` crate (which
includes most of the changes), i.e. up to commit d072acda4862 ("rust:
use custom FFI integer types") but without doing the big remapping
just yet, so that others have it available for their branches, and
then take that last part later, ideally early in a cycle.

Gary: what do you think?

Thanks!

(Relatedly, I have been thinking of moving the `c_*` types into the prelude).

Cheers,
Miguel