Re: [RFC v3 12/27] lib: rspdm: Support SPDM get_version

From: Miguel Ojeda

Date: Fri Mar 13 2026 - 01:54:27 EST


On Fri, Mar 13, 2026 at 6:36 AM Alistair Francis <alistair23@xxxxxxxxx> wrote:
>
> This is a public function that matches the C implementation, hence the
> arguments being fixed in the previous patch.

Since you have it in a C header and in `bindings_helper.h`, then you
should be able to use `#[export]`, which will do a typecheck that the
signatures match (it also does the `no_mangle`, so you can replace
it):

https://rust.docs.kernel.org/macros/attr.export.html

> This is just how the linter formats it when I run ` LLVM=1 make
> rustfmt`. I don't really want to be manually formatting things

Please use the "kernel vertical style" for imports (it is done
automatically by `rustfmt` too by adding the `//`):

https://docs.kernel.org/rust/coding-guidelines.html#imports

We have `size_of`, `align_of` and so on in the prelude, so you can use
those directly:

https://rust.docs.kernel.org/kernel/prelude/index.html

I hope that helps!

Cheers,
Miguel