[RFC 1/6] rust: bindings: Support SPDM bindings

Alistair Francis posted 6 patches 1 week ago
[RFC 1/6] rust: bindings: Support SPDM bindings
Posted by Alistair Francis 1 week ago
In preparation for a Rust SPDM library we need to include the SPDM
functions in the Rust bindings.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
---
 rust/bindings/bindings_helper.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
index 7847b2b3090b..8283e6a79ac9 100644
--- a/rust/bindings/bindings_helper.h
+++ b/rust/bindings/bindings_helper.h
@@ -24,6 +24,7 @@
 #include <linux/sched/signal.h>
 #include <linux/sched/task.h>
 #include <linux/slab.h>
+#include <linux/spdm.h>
 #include <linux/uaccess.h>
 #include <linux/wait.h>
 #include <linux/workqueue.h>
-- 
2.47.0
Re: [RFC 1/6] rust: bindings: Support SPDM bindings
Posted by Bjorn Helgaas 1 week ago
On Fri, Nov 15, 2024 at 03:46:11PM +1000, Alistair Francis wrote:
> In preparation for a Rust SPDM library we need to include the SPDM
> functions in the Rust bindings.
> 
> Signed-off-by: Alistair Francis <alistair@alistair23.me>
> ---
>  rust/bindings/bindings_helper.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
> index 7847b2b3090b..8283e6a79ac9 100644
> --- a/rust/bindings/bindings_helper.h
> +++ b/rust/bindings/bindings_helper.h
> @@ -24,6 +24,7 @@
>  #include <linux/sched/signal.h>
>  #include <linux/sched/task.h>
>  #include <linux/slab.h>
> +#include <linux/spdm.h>

Usually an additional #include goes in the same patch that makes use
of the new .h file.  Maybe there's a different convention in rust/?

>  #include <linux/uaccess.h>
>  #include <linux/wait.h>
>  #include <linux/workqueue.h>
> -- 
> 2.47.0
>
Re: [RFC 1/6] rust: bindings: Support SPDM bindings
Posted by Miguel Ojeda 1 week ago
On Fri, Nov 15, 2024 at 6:53 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> Usually an additional #include goes in the same patch that makes use
> of the new .h file.  Maybe there's a different convention in rust/?

I think doing it in the same patch makes more sense, i.e. please feel
free to avoid a "rust: bindings: ..."-titled patch.

It is also how it has been done in the past, e.g. see commit
de6582833db0 ("rust: add firmware abstractions").

Cheers,
Miguel