Skip to content

Commit 93ad1d7

Browse files
Darksonnojeda
authored andcommitted
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>
1 parent 4890cd1 commit 93ad1d7

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

rust/helpers/uaccess.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,26 @@
22

33
#include <linux/uaccess.h>
44

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)
77
{
88
return copy_from_user(to, from, n);
99
}
1010

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)
1313
{
1414
return copy_to_user(to, from, n);
1515
}
1616

1717
#ifdef INLINE_COPY_FROM_USER
18+
__rust_helper
1819
unsigned long rust_helper__copy_from_user(void *to, const void __user *from, unsigned long n)
1920
{
2021
return _inline_copy_from_user(to, from, n);
2122
}
2223

24+
__rust_helper
2325
unsigned long rust_helper__copy_to_user(void __user *to, const void *from, unsigned long n)
2426
{
2527
return _inline_copy_to_user(to, from, n);

0 commit comments

Comments
 (0)