Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: uaccess: add __rust_helper to helpers

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>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-23-51da5f454a67@google.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Alice Ryhl and committed by
Miguel Ojeda
93ad1d73 4890cd1d

+6 -4
+6 -4
rust/helpers/uaccess.c
··· 2 2 3 3 #include <linux/uaccess.h> 4 4 5 - unsigned long rust_helper_copy_from_user(void *to, const void __user *from, 6 - unsigned long n) 5 + __rust_helper unsigned long 6 + rust_helper_copy_from_user(void *to, const void __user *from, unsigned long n) 7 7 { 8 8 return copy_from_user(to, from, n); 9 9 } 10 10 11 - unsigned long rust_helper_copy_to_user(void __user *to, const void *from, 12 - unsigned long n) 11 + __rust_helper unsigned long 12 + rust_helper_copy_to_user(void __user *to, const void *from, unsigned long n) 13 13 { 14 14 return copy_to_user(to, from, n); 15 15 } 16 16 17 17 #ifdef INLINE_COPY_FROM_USER 18 + __rust_helper 18 19 unsigned long rust_helper__copy_from_user(void *to, const void __user *from, unsigned long n) 19 20 { 20 21 return _inline_copy_from_user(to, from, n); 21 22 } 22 23 24 + __rust_helper 23 25 unsigned long rust_helper__copy_to_user(void __user *to, const void *from, unsigned long n) 24 26 { 25 27 return _inline_copy_to_user(to, from, n);