[PATCH v2 24/27] rust: usb: add __rust_helper to helpers

Alice Ryhl posted 27 patches 1 month ago
[PATCH v2 24/27] rust: usb: add __rust_helper to helpers
Posted by Alice Ryhl 1 month ago
This is needed to inline these helpers into Rust code.

Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: Daniel Almeida <daniel.almeida@collabora.com>
---
 rust/helpers/usb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/rust/helpers/usb.c b/rust/helpers/usb.c
index fb2aad0cbf4d26ac7fb1a3f176ee7a1d30800f92..eff1cf7be3c2d10b7e9248252d354eb8a4fd4c94 100644
--- a/rust/helpers/usb.c
+++ b/rust/helpers/usb.c
@@ -2,7 +2,8 @@
 
 #include <linux/usb.h>
 
-struct usb_device *rust_helper_interface_to_usbdev(struct usb_interface *intf)
+__rust_helper struct usb_device *
+rust_helper_interface_to_usbdev(struct usb_interface *intf)
 {
 	return interface_to_usbdev(intf);
 }

-- 
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 24/27] rust: usb: add __rust_helper to helpers
Posted by Daniel Almeida 1 month ago

> On 5 Jan 2026, at 09:42, Alice Ryhl <aliceryhl@google.com> wrote:
> 
> This is needed to inline these helpers into Rust code.
> 
> Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-usb@vger.kernel.org
> Cc: Daniel Almeida <daniel.almeida@collabora.com>
> ---
> rust/helpers/usb.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/rust/helpers/usb.c b/rust/helpers/usb.c
> index fb2aad0cbf4d26ac7fb1a3f176ee7a1d30800f92..eff1cf7be3c2d10b7e9248252d354eb8a4fd4c94 100644
> --- a/rust/helpers/usb.c
> +++ b/rust/helpers/usb.c
> @@ -2,7 +2,8 @@
> 
> #include <linux/usb.h>
> 
> -struct usb_device *rust_helper_interface_to_usbdev(struct usb_interface *intf)
> +__rust_helper struct usb_device *
> +rust_helper_interface_to_usbdev(struct usb_interface *intf)
> {
> return interface_to_usbdev(intf);
> }
> 
> -- 
> 2.52.0.351.gbe84eed79e-goog
> 
> 


Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>